package blender.makesrna;

import static blender.makesdna.NodeTypes.NTREE_COMPOSIT;
import static blender.makesdna.NodeTypes.NTREE_SHADER;
import static blender.makesdna.NodeTypes.NTREE_TEXTURE;
import static blender.makesdna.SpaceTypes.BCONTEXT_BONE;
import static blender.makesdna.SpaceTypes.BCONTEXT_BONE_CONSTRAINT;
import static blender.makesdna.SpaceTypes.BCONTEXT_CONSTRAINT;
import static blender.makesdna.SpaceTypes.BCONTEXT_DATA;
import static blender.makesdna.SpaceTypes.BCONTEXT_MATERIAL;
import static blender.makesdna.SpaceTypes.BCONTEXT_MODIFIER;
import static blender.makesdna.SpaceTypes.BCONTEXT_OBJECT;
import static blender.makesdna.SpaceTypes.BCONTEXT_PARTICLE;
import static blender.makesdna.SpaceTypes.BCONTEXT_PHYSICS;
import static blender.makesdna.SpaceTypes.BCONTEXT_RENDER;
import static blender.makesdna.SpaceTypes.BCONTEXT_SCENE;
import static blender.makesdna.SpaceTypes.BCONTEXT_TEXTURE;
import static blender.makesdna.SpaceTypes.BCONTEXT_WORLD;
import static blender.makesdna.SpaceTypes.BUT_HORIZONTAL;
import static blender.makesdna.SpaceTypes.BUT_VERTICAL;
import static blender.makesdna.SpaceTypes.INFO_RPT_DEBUG;
import static blender.makesdna.SpaceTypes.INFO_RPT_ERR;
import static blender.makesdna.SpaceTypes.INFO_RPT_INFO;
import static blender.makesdna.SpaceTypes.INFO_RPT_OP;
import static blender.makesdna.SpaceTypes.INFO_RPT_WARN;
import static blender.makesdna.SpaceTypes.SB_BRUSH_TEX;
import static blender.makesdna.SpaceTypes.SB_PIN_CONTEXT;
import static blender.makesdna.SpaceTypes.SNODE_BACKDRAW;
import static blender.makesdna.SpaceTypes.SNODE_TEX_BRUSH;
import static blender.makesdna.SpaceTypes.SNODE_TEX_OBJECT;
import static blender.makesdna.SpaceTypes.SNODE_TEX_WORLD;
import static blender.makesdna.SpaceTypes.SO_ACTIVE;
import static blender.makesdna.SpaceTypes.SO_ALL_SCENES;
import static blender.makesdna.SpaceTypes.SO_CUR_SCENE;
import static blender.makesdna.SpaceTypes.SO_DATABLOCKS;
import static blender.makesdna.SpaceTypes.SO_FIND_CASE_SENSITIVE;
import static blender.makesdna.SpaceTypes.SO_FIND_COMPLETE;
import static blender.makesdna.SpaceTypes.SO_GROUPS;
import static blender.makesdna.SpaceTypes.SO_HIDE_RESTRICTCOLS;
import static blender.makesdna.SpaceTypes.SO_KEYMAP;
import static blender.makesdna.SpaceTypes.SO_LIBRARIES;
import static blender.makesdna.SpaceTypes.SO_SAME_TYPE;
import static blender.makesdna.SpaceTypes.SO_SELECTED;
import static blender.makesdna.SpaceTypes.SO_SEQUENCE;
import static blender.makesdna.SpaceTypes.SO_USERDEF;
import static blender.makesdna.SpaceTypes.SO_VISIBLE;
import static blender.makesdna.SpaceTypes.SPACE_ACTION;
import static blender.makesdna.SpaceTypes.SPACE_BUTS;
import static blender.makesdna.SpaceTypes.SPACE_CONSOLE;
import static blender.makesdna.SpaceTypes.SPACE_EMPTY;
import static blender.makesdna.SpaceTypes.SPACE_FILE;
import static blender.makesdna.SpaceTypes.SPACE_IMAGE;
import static blender.makesdna.SpaceTypes.SPACE_INFO;
import static blender.makesdna.SpaceTypes.SPACE_IPO;
import static blender.makesdna.SpaceTypes.SPACE_LOGIC;
import static blender.makesdna.SpaceTypes.SPACE_NLA;
import static blender.makesdna.SpaceTypes.SPACE_NODE;
import static blender.makesdna.SpaceTypes.SPACE_OUTLINER;
import static blender.makesdna.SpaceTypes.SPACE_SCRIPT;
import static blender.makesdna.SpaceTypes.SPACE_SEQ;
import static blender.makesdna.SpaceTypes.SPACE_SOUND;
import static blender.makesdna.SpaceTypes.SPACE_TEXT;
import static blender.makesdna.SpaceTypes.SPACE_TIME;
import static blender.makesdna.SpaceTypes.SPACE_USERPREF;
import static blender.makesdna.SpaceTypes.SPACE_VIEW3D;
import static blender.makesdna.SpaceTypes.TIME_ALL_3D_WIN;
import static blender.makesdna.SpaceTypes.TIME_ALL_ANIM_WIN;
import static blender.makesdna.SpaceTypes.TIME_ALL_BUTS_WIN;
import static blender.makesdna.SpaceTypes.TIME_ALL_IMAGE_WIN;
import static blender.makesdna.SpaceTypes.TIME_CACHE_CLOTH;
import static blender.makesdna.SpaceTypes.TIME_CACHE_DISPLAY;
import static blender.makesdna.SpaceTypes.TIME_CACHE_PARTICLES;
import static blender.makesdna.SpaceTypes.TIME_CACHE_SMOKE;
import static blender.makesdna.SpaceTypes.TIME_CACHE_SOFTBODY;
import static blender.makesdna.SpaceTypes.TIME_CFRA_NUM;
import static blender.makesdna.SpaceTypes.TIME_NODES;
import static blender.makesdna.SpaceTypes.TIME_ONLYACTSEL;
import static blender.makesdna.SpaceTypes.TIME_REGION;
import static blender.makesdna.SpaceTypes.TIME_SEQ;
import static blender.makesrna.RNATypes.PROP_BOOLEAN;
import static blender.makesrna.RNATypes.PROP_COLLECTION;
import static blender.makesrna.RNATypes.PROP_DISTANCE;
import static blender.makesrna.RNATypes.PROP_EDITABLE;
import static blender.makesrna.RNATypes.PROP_ENUM;
import static blender.makesrna.RNATypes.PROP_FLOAT;
import static blender.makesrna.RNATypes.PROP_INT;
import static blender.makesrna.RNATypes.PROP_LAYER_MEMBER;
import static blender.makesrna.RNATypes.PROP_MATRIX;
import static blender.makesrna.RNATypes.PROP_NONE;
import static blender.makesrna.RNATypes.PROP_POINTER;
import static blender.makesrna.RNATypes.PROP_QUATERNION;
import static blender.makesrna.RNATypes.PROP_STRING;
import static blender.makesrna.RNATypes.PROP_TRANSLATION;
import static blender.makesrna.RNATypes.PROP_UNSIGNED;
import static blender.makesrna.RNATypes.PROP_XYZ_LENGTH;
import static blender.makesrna.RnaDefine.FLT_MAX;
import static blender.makesrna.RnaDefine.RNA_def_property;
import static blender.makesrna.RnaDefine.RNA_def_property_array;
import static blender.makesrna.RnaDefine.RNA_def_property_boolean_funcs;
import static blender.makesrna.RnaDefine.RNA_def_property_boolean_negative_sdna;
import static blender.makesrna.RnaDefine.RNA_def_property_boolean_sdna;
import static blender.makesrna.RnaDefine.RNA_def_property_clear_flag;
import static blender.makesrna.RnaDefine.RNA_def_property_collection_sdna;
import static blender.makesrna.RnaDefine.RNA_def_property_enum_funcs;
import static blender.makesrna.RnaDefine.RNA_def_property_enum_items;
import static blender.makesrna.RnaDefine.RNA_def_property_enum_sdna;
import static blender.makesrna.RnaDefine.RNA_def_property_flag;
import static blender.makesrna.RnaDefine.RNA_def_property_float_funcs;
import static blender.makesrna.RnaDefine.RNA_def_property_float_sdna;
import static blender.makesrna.RnaDefine.RNA_def_property_int_sdna;
import static blender.makesrna.RnaDefine.RNA_def_property_multi_array;
import static blender.makesrna.RnaDefine.RNA_def_property_pointer_funcs;
import static blender.makesrna.RnaDefine.RNA_def_property_pointer_sdna;
import static blender.makesrna.RnaDefine.RNA_def_property_range;
import static blender.makesrna.RnaDefine.RNA_def_property_string_sdna;
import static blender.makesrna.RnaDefine.RNA_def_property_struct_type;
import static blender.makesrna.RnaDefine.RNA_def_property_ui_icon;
import static blender.makesrna.RnaDefine.RNA_def_property_ui_range;
import static blender.makesrna.RnaDefine.RNA_def_property_ui_text;
import static blender.makesrna.RnaDefine.RNA_def_property_update;
import static blender.makesrna.RnaDefine.RNA_def_struct;
import static blender.makesrna.RnaDefine.RNA_def_struct_refine_func;
import static blender.makesrna.RnaDefine.RNA_def_struct_sdna;
import static blender.makesrna.RnaDefine.RNA_def_struct_ui_text;
import static blender.windowmanager.WmTypes.NC_SPACE;
import static blender.windowmanager.WmTypes.NC_WINDOW;
import static blender.windowmanager.WmTypes.ND_SPACE_INFO_REPORT;
import static blender.windowmanager.WmTypes.ND_SPACE_NODE;
import static blender.windowmanager.WmTypes.ND_SPACE_NODE_VIEW;
import static blender.windowmanager.WmTypes.ND_SPACE_OUTLINER;
import static blender.windowmanager.WmTypes.ND_SPACE_PROPERTIES;
import static blender.windowmanager.WmTypes.ND_SPACE_TIME;
import static blender.windowmanager.WmTypes.ND_SPACE_VIEW3D;
import blender.blenkernel.bContext;
import blender.editors.uinterface.Resources.BIFIconID;
import blender.makesdna.ObjectTypes;
import blender.makesdna.SpaceTypes;
import blender.makesdna.View3dTypes;
import blender.makesdna.sdna.SpaceLink;
import blender.makesrna.Makesrna.RNAProcess;
import blender.makesrna.RNATypes.EnumPropertyItem;
import blender.makesrna.RNATypes.PointerRNA;
import blender.makesrna.rna_internal_types.BlenderRNA;
import blender.makesrna.rna_internal_types.PropEnumSetFunc;
import blender.makesrna.rna_internal_types.PropPointerSetFunc;
import blender.makesrna.rna_internal_types.PropPointerTypeFunc;
import blender.makesrna.rna_internal_types.PropertyRNA;
import blender.makesrna.rna_internal_types.StructRNA;
import blender.makesrna.rna_internal_types.StructRefineFunc;
import blender.makesrna.rna_internal_types.UpdateFunc;
import blender.makesrna.srna.RnaSpace;
import blender.makesrna.srna.RnaSpaceInfo;
import blender.makesrna.srna.RnaSpaceNodeEditor;
import blender.makesrna.srna.RnaSpaceOutliner;
import blender.makesrna.srna.RnaSpaceTimeline;
import blender.makesrna.srna.RnaSpaceView3D;

public class RnaSpaceUtil {
//	/**
//	 * $Id: rna_space.c 33490 2010-12-05 18:59:23Z blendix $
//	 *
//	 * ***** BEGIN GPL LICENSE BLOCK *****
//	 *
//	 * This program is free software; you can redistribute it and/or
//	 * modify it under the terms of the GNU General Public License
//	 * as published by the Free Software Foundation; either version 2
//	 * of the License, or (at your option) any later version.
//	 *
//	 * This program is distributed in the hope that it will be useful,
//	 * but WITHOUT ANY WARRANTY; without even the implied warranty of
//	 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	 * GNU General Public License for more details.
//	 *
//	 * You should have received a copy of the GNU General Public License
//	 * along with this program; if not, write to the Free Software Foundation,
//	 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//	 *
//	 * Contributor(s): Blender Foundation (2008)
//	 *
//	 * ***** END GPL LICENSE BLOCK *****
//	 */
//
//	#include <stdlib.h>
//
//	#include "MEM_guardedalloc.h"
//
//	#include "RNA_access.h"
//	#include "RNA_define.h"
//
//	#include "rna_internal.h"
//
//	#include "BKE_key.h"
//
//	#include "DNA_action_types.h"
//	#include "DNA_key_types.h"
//	#include "DNA_node_types.h"
//	#include "DNA_object_types.h"
//	#include "DNA_space_types.h"
//	#include "DNA_view3d_types.h"
//
//	#include "WM_api.h"
//	#include "WM_types.h"

	public static EnumPropertyItem[] space_type_items = {
		new EnumPropertyItem(SPACE_EMPTY, "EMPTY", 0, "Empty", ""),
		new EnumPropertyItem(SPACE_VIEW3D, "VIEW_3D", 0, "3D View", ""),
		new EnumPropertyItem(SPACE_IPO, "GRAPH_EDITOR", 0, "Graph Editor", ""),
		new EnumPropertyItem(SPACE_OUTLINER, "OUTLINER", 0, "Outliner", ""),
		new EnumPropertyItem(SPACE_BUTS, "PROPERTIES", 0, "Properties", ""),
		new EnumPropertyItem(SPACE_FILE, "FILE_BROWSER", 0, "File Browser", ""),
		new EnumPropertyItem(SPACE_IMAGE, "IMAGE_EDITOR", 0, "Image Editor", ""),
		new EnumPropertyItem(SPACE_INFO, "INFO", 0, "Info", ""),
		new EnumPropertyItem(SPACE_SEQ, "SEQUENCE_EDITOR", 0, "Sequence Editor", ""),
		new EnumPropertyItem(SPACE_TEXT, "TEXT_EDITOR", 0, "Text Editor", ""),
		//{SPACE_IMASEL, "IMAGE_BROWSER", 0, "Image Browser", ""},
		new EnumPropertyItem(SPACE_SOUND, "AUDIO_WINDOW", 0, "Audio Window", ""),
		new EnumPropertyItem(SPACE_ACTION, "DOPESHEET_EDITOR", 0, "DopeSheet Editor", ""),
		new EnumPropertyItem(SPACE_NLA, "NLA_EDITOR", 0, "NLA Editor", ""),
		new EnumPropertyItem(SPACE_SCRIPT, "SCRIPTS_WINDOW", 0, "Scripts Window", ""),
		new EnumPropertyItem(SPACE_TIME, "TIMELINE", 0, "Timeline", ""),
		new EnumPropertyItem(SPACE_NODE, "NODE_EDITOR", 0, "Node Editor", ""),
		new EnumPropertyItem(SPACE_LOGIC, "LOGIC_EDITOR", 0, "Logic Editor", ""),
		new EnumPropertyItem(SPACE_CONSOLE, "CONSOLE", 0, "Python Console", ""),
		new EnumPropertyItem(SPACE_USERPREF, "USER_PREFERENCES", 0, "User Preferences", ""),
		new EnumPropertyItem(0, null, 0, null, null)};

//	static EnumPropertyItem draw_channels_items[] = {
//		{0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"},
//		{SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency"},
//		{SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"},
//		{SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer", "Draw Z-buffer associated with image (mapped from camera clip start to end)"},
//	#ifdef WITH_LCMS
//		{SI_COLOR_CORRECTION, "COLOR_CORRECTED", ICON_IMAGE_ALPHA, "Color Corrected", "Display color corrected image"},
//	#endif
//		{0, NULL, 0, NULL, NULL}};

	static EnumPropertyItem[] transform_orientation_items = {
		new EnumPropertyItem(View3dTypes.V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", "Align the transformation axes to world space"),
		new EnumPropertyItem(View3dTypes.V3D_MANIP_LOCAL, "LOCAL", 0, "Local", "Align the transformation axes to the selected objects' local space"),
		new EnumPropertyItem(View3dTypes.V3D_MANIP_GIMBAL, "GIMBAL", 0, "Gimbal", "Align each axis to the euler rotation axis as used for input"),
		new EnumPropertyItem(View3dTypes.V3D_MANIP_NORMAL, "NORMAL", 0, "Normal", "Align the transformation axes to average normal of selected elements (bone Y axis for pose mode)"),
		new EnumPropertyItem(View3dTypes.V3D_MANIP_VIEW, "VIEW", 0, "View", "Align the transformation axes to the window"),
		new EnumPropertyItem(View3dTypes.V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"),
		new EnumPropertyItem(0, null, 0, null, null)};

//	EnumPropertyItem autosnap_items[] = {
//		{SACTSNAP_OFF, "NONE", 0, "No Auto-Snap", ""},
//		{SACTSNAP_STEP, "STEP", 0, "Time Step", "Snap to 1.0 frame/second intervals"},
//		{SACTSNAP_FRAME, "FRAME", 0, "Nearest Frame", "Snap to actual frames/seconds (nla-action time)"},
//		{SACTSNAP_MARKER, "MARKER", 0, "Nearest Marker", "Snap to nearest marker"},
//		{0, NULL, 0, NULL, NULL}};

	static EnumPropertyItem[] viewport_shade_items = {
		new EnumPropertyItem(ObjectTypes.OB_BOUNDBOX, "BOUNDBOX", BIFIconID.ICON_BBOX.ordinal(), "Bounding Box", "Display the object's local bounding boxes only"),
		new EnumPropertyItem(ObjectTypes.OB_WIRE, "WIREFRAME", BIFIconID.ICON_WIRE.ordinal(), "Wireframe", "Display the object as wire edges"),
		new EnumPropertyItem(ObjectTypes.OB_SOLID, "SOLID", BIFIconID.ICON_SOLID.ordinal(), "Solid", "Display the object solid, lit with default OpenGL lights"),
		//new EnumPropertyItem(OB_SHADED, "SHADED", ICON_SMOOTH, "Shaded", "Display the object solid, with preview shading interpolated at vertices"),
		new EnumPropertyItem(ObjectTypes.OB_TEXTURE, "TEXTURED", BIFIconID.ICON_POTATO.ordinal(), "Textured", "Display the object solid, with face-assigned textures"),
		new EnumPropertyItem(0, null, 0, null, null)};

//	#ifdef RNA_RUNTIME
//
//	#include "DNA_anim_types.h"
//	#include "DNA_scene_types.h"
//	#include "DNA_screen_types.h"
//
//	#include "BLI_math.h"
//
//	#include "BKE_animsys.h"
//	#include "BKE_brush.h"
//	#include "BKE_colortools.h"
//	#include "BKE_context.h"
//	#include "BKE_depsgraph.h"
//	#include "BKE_paint.h"
//
//	#include "ED_image.h"
//	#include "ED_screen.h"
//	#include "ED_view3d.h"
//	#include "ED_sequencer.h"
//
//	#include "IMB_imbuf_types.h"

	public static StructRefineFunc rna_Space_refine = new StructRefineFunc() {
	public StructRNA refine(PointerRNA ptr)
	{
		SpaceLink space= (SpaceLink)ptr.data;

		switch(space.spacetype) {
			case SpaceTypes.SPACE_VIEW3D:
				return RnaSpaceView3D.RNA_SpaceView3D;
			case SpaceTypes.SPACE_IPO:
				return RnaAccess.RNA_SpaceGraphEditor;
			case SpaceTypes.SPACE_OUTLINER:
				return RnaSpaceOutliner.RNA_SpaceOutliner;
			case SpaceTypes.SPACE_BUTS:
				return RnaAccess.RNA_SpaceProperties;
			case SpaceTypes.SPACE_FILE:
				return RnaAccess.RNA_SpaceFileBrowser;
			case SpaceTypes.SPACE_IMAGE:
				return RnaAccess.RNA_SpaceImageEditor;
			case SpaceTypes.SPACE_INFO:
				return RnaSpaceInfo.RNA_SpaceInfo;
			case SpaceTypes.SPACE_SEQ:
				return RnaAccess.RNA_SpaceSequenceEditor;
			case SpaceTypes.SPACE_TEXT:
				return RnaAccess.RNA_SpaceTextEditor;
			//case SpaceTypes.SPACE_IMASEL:
			//	return &RNA_SpaceImageBrowser;
			/*case SpaceTypes.SPACE_SOUND:
				return &RNA_SpaceAudioWindow;*/
			case SpaceTypes.SPACE_ACTION:
				return RnaAccess.RNA_SpaceDopeSheetEditor;
			case SpaceTypes.SPACE_NLA:
				return RnaAccess.RNA_SpaceNLA;
			/*case SpaceTypes.SPACE_SCRIPT:
				return &RNA_SpaceScriptsWindow;*/
			case SpaceTypes.SPACE_TIME:
				return RnaSpaceTimeline.RNA_SpaceTimeline;
			case SpaceTypes.SPACE_NODE:
				return RnaSpaceNodeEditor.RNA_SpaceNodeEditor;
			case SpaceTypes.SPACE_LOGIC:
				return RnaAccess.RNA_SpaceLogicEditor;
			case SpaceTypes.SPACE_CONSOLE:
				return RnaAccess.RNA_SpaceConsole;
			case SpaceTypes.SPACE_USERPREF:
				return RnaAccess.RNA_SpaceUserPreferences;
			default:
				return RnaSpace.RNA_Space;
		}
	}
	public String getName() { return "rna_Space_refine"; }
	};

//	static ScrArea *rna_area_from_space(PointerRNA *ptr)
//	{
//		bScreen *sc = (bScreen*)ptr->id.data;
//		SpaceLink *link= (SpaceLink*)ptr->data;
//		ScrArea *sa;
//
//		for(sa=sc->areabase.first; sa; sa=sa->next)
//			if(BLI_findindex(&sa->spacedata, link) != -1)
//				return sa;
//
//		return NULL;
//	}
//
//	static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **sa_r, ARegion **ar_r)
//	{
//		bScreen *sc = (bScreen*)ptr->id.data;
//		ScrArea *sa;
//		ARegion *ar;
//		void *regiondata= ptr->data;
//
//		*sa_r= NULL;
//		*ar_r= NULL;
//
//		for(sa=sc->areabase.first; sa; sa=sa->next) {
//			for(ar=sa->regionbase.first; ar; ar=ar->next) {
//				if(ar->regiondata == regiondata) {
//					*sa_r= sa;
//					*ar_r= ar;
//					return;
//				}
//			}
//		}
//	}
//
//	static PointerRNA rna_CurrentOrientation_get(PointerRNA *ptr)
//	{
//		Scene *scene = ((bScreen*)ptr->id.data)->scene;
//		View3D *v3d= (View3D*)ptr->data;
//		
//		if (v3d->twmode < V3D_MANIP_CUSTOM)
//			return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, NULL);
//		else
//			return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, BLI_findlink(&scene->transform_spaces, v3d->twmode - V3D_MANIP_CUSTOM));
//	}
//
//	EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, int *free)
//	{
//		Scene *scene = NULL;
//		ListBase *transform_spaces;
//		TransformOrientation *ts= NULL;
//		EnumPropertyItem tmp = {0, "", 0, "", ""};
//		EnumPropertyItem *item= NULL;
//		int i = V3D_MANIP_CUSTOM, totitem= 0;
//
//		RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_GLOBAL);
//		RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_NORMAL);
//		RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_GIMBAL);
//		RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_LOCAL);
//		RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_VIEW);
//
//		if (ptr->type == &RNA_SpaceView3D)
//			scene = ((bScreen*)ptr->id.data)->scene;
//		else
//			scene = CTX_data_scene(C); /* can't use scene from ptr->id.data because that enum is also used by operators */
//
//		if(scene) {
//			transform_spaces = &scene->transform_spaces;
//			ts = transform_spaces->first;
//		}
//
//		if(ts)
//		{
//			RNA_enum_item_add_separator(&item, &totitem);
//
//			for(; ts; ts = ts->next) {
//				tmp.identifier = ts->name;
//				tmp.name= ts->name;
//				tmp.value = i++;
//				RNA_enum_item_add(&item, &totitem, &tmp);
//			}
//		}
//
//		RNA_enum_item_end(&item, &totitem);
//		*free= 1;
//
//		return item;
//	}
//
//	/* Space 3D View */
//	static void rna_SpaceView3D_lock_camera_and_layers_set(PointerRNA *ptr, int value)
//	{
//		View3D *v3d= (View3D*)(ptr->data);
//		bScreen *sc= (bScreen*)ptr->id.data;
//
//		v3d->scenelock = value;
//
//		if(value) {
//			int bit;
//			v3d->lay= sc->scene->lay;
//			/* seek for layact */
//			bit= 0;
//			while(bit<32) {
//				if(v3d->lay & (1<<bit)) {
//					v3d->layact= 1<<bit;
//					break;
//				}
//				bit++;
//			}
//			v3d->camera= sc->scene->camera;
//		}
//	}
//
//	static void rna_View3D_CursorLocation_get(PointerRNA *ptr, float *values)
//	{
//		View3D *v3d= (View3D*)(ptr->data);
//		bScreen *sc= (bScreen*)ptr->id.data;
//		Scene *scene= (Scene *)sc->scene;
//		float *loc = give_cursor(scene, v3d);
//		
//		copy_v3_v3(values, loc);
//	}
//
//	static void rna_View3D_CursorLocation_set(PointerRNA *ptr, const float *values)
//	{
//		View3D *v3d= (View3D*)(ptr->data);
//		bScreen *sc= (bScreen*)ptr->id.data;
//		Scene *scene= (Scene *)sc->scene;
//		float *cursor = give_cursor(scene, v3d);
//		
//		copy_v3_v3(cursor, values);
//	}
//
//	static void rna_SpaceView3D_layer_set(PointerRNA *ptr, const int *values)
//	{
//		View3D *v3d= (View3D*)(ptr->data);
//		
//		v3d->lay= ED_view3d_scene_layer_set(v3d->lay, values, &v3d->layact);
//	}
//
//	static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr)
//	{
//		View3D *v3d= (View3D*)(ptr->data);
//		ScrArea *sa= rna_area_from_space(ptr);
//		void *regiondata= NULL;
//		if(sa) {
//			ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
//			ARegion *ar= regionbase->last; /* always last in list, weak .. */
//			regiondata= ar->regiondata;
//		}
//
//		return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, regiondata);
//	}
//
//	static PointerRNA rna_SpaceView3D_region_quadview_get(PointerRNA *ptr)
//	{
//		View3D *v3d= (View3D*)(ptr->data);
//		ScrArea *sa= rna_area_from_space(ptr);
//		void *regiondata= NULL;
//		if(sa) {
//			ListBase *regionbase= (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase;
//			ARegion *ar= regionbase->last; /* always before last in list, weak .. */
//
//			ar= (ar->alignment == RGN_ALIGN_QSPLIT)? ar->prev: NULL;
//			if(ar) {
//				regiondata= ar->regiondata;
//			}
//		}
//
//		return rna_pointer_inherit_refine(ptr, &RNA_RegionView3D, regiondata);
//	}
//
//	static void rna_RegionView3D_quadview_update(Main *main, Scene *scene, PointerRNA *ptr)
//	{
//		ScrArea *sa;
//		ARegion *ar;
//
//		rna_area_region_from_regiondata(ptr, &sa, &ar);
//		if(sa && ar && ar->alignment==RGN_ALIGN_QSPLIT)
//			ED_view3d_quadview_update(sa, ar, FALSE);
//	}
//
//	/* same as above but call clip==TRUE */
//	static void rna_RegionView3D_quadview_clip_update(Main *main, Scene *scene, PointerRNA *ptr)
//	{
//		ScrArea *sa;
//		ARegion *ar;
//
//		rna_area_region_from_regiondata(ptr, &sa, &ar);
//		if(sa && ar && ar->alignment==RGN_ALIGN_QSPLIT)
//			ED_view3d_quadview_update(sa, ar, TRUE);
//	}
//
//	static void rna_RegionView3D_view_location_get(PointerRNA *ptr, float *values)
//	{
//		RegionView3D *rv3d= (RegionView3D *)(ptr->data);
//		negate_v3_v3(values, rv3d->ofs);
//	}
//
//	static void rna_RegionView3D_view_location_set(PointerRNA *ptr, const float *values)
//	{
//		RegionView3D *rv3d= (RegionView3D *)(ptr->data);
//		negate_v3_v3(rv3d->ofs, values);
//	}
//
//	/* Space Image Editor */
//
//	static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr)
//	{
//		return rna_pointer_inherit_refine(ptr, &RNA_SpaceUVEditor, ptr->data);
//	}
//
//	static void rna_SpaceImageEditor_paint_update(Main *bmain, Scene *scene, PointerRNA *ptr)
//	{
//		paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT);
//
//		ED_space_image_paint_update(bmain->wm.first, scene->toolsettings);
//	}
//
//	static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr)
//	{
//		SpaceImage *sima= (SpaceImage*)(ptr->data);
//		return ED_space_image_show_render(sima);
//	}
//
//	static int rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr)
//	{
//		SpaceImage *sima= (SpaceImage*)(ptr->data);
//		return ED_space_image_show_paint(sima);
//	}
//
//	static int rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr)
//	{
//		SpaceImage *sima= (SpaceImage*)(ptr->data);
//		bScreen *sc= (bScreen*)ptr->id.data;
//		return ED_space_image_show_uvedit(sima, sc->scene->obedit);
//	}
//
//	static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value)
//	{
//		SpaceImage *sima= (SpaceImage*)(ptr->data);
//		bScreen *sc= (bScreen*)ptr->id.data;
//
//		ED_space_image_set(NULL, sima, sc->scene, sc->scene->obedit, (Image*)value.data);
//	}
//
//	static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *C, PointerRNA *ptr, int *free)
//	{
//		SpaceImage *sima= (SpaceImage*)ptr->data;
//		EnumPropertyItem *item= NULL;
//		ImBuf *ibuf;
//		void *lock;
//		int zbuf, alpha, totitem= 0;
//
//		ibuf= ED_space_image_acquire_buffer(sima, &lock);
//		
//		alpha= ibuf && (ibuf->channels == 4);
//		zbuf= ibuf && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1));
//
//		ED_space_image_release_buffer(sima, lock);
//
//		if(alpha && zbuf)
//			return draw_channels_items;
//
//		RNA_enum_items_add_value(&item, &totitem, draw_channels_items, 0);
//
//		if(alpha) {
//			RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_USE_ALPHA);
//			RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ALPHA);
//		}
//		else if(zbuf) {
//			RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_SHOW_ZBUF);
//		}
//
//	#ifdef WITH_LCMS
//		RNA_enum_items_add_value(&item, &totitem, draw_channels_items, SI_COLOR_CORRECTION);
//	#endif
//
//		RNA_enum_item_end(&item, &totitem);
//		*free= 1;
//
//		return item;
//	}
//
//	static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *values)
//	{
//		SpaceImage *sima= (SpaceImage*)ptr->data;
//		
//		if (sima->flag & SI_COORDFLOATS) {
//			copy_v2_v2(values, sima->cursor);
//		} else {
//			int w, h;
//			ED_space_image_size(sima, &w, &h);
//			
//			values[0] = sima->cursor[0] * w;
//			values[1] = sima->cursor[1] * h;
//		}
//	}
//
//	static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const float *values)
//	{
//		SpaceImage *sima= (SpaceImage*)ptr->data;
//		
//		if (sima->flag & SI_COORDFLOATS) {
//			copy_v2_v2(sima->cursor, values);
//		} else {
//			int w, h;
//			ED_space_image_size(sima, &w, &h);
//			
//			sima->cursor[0] = values[0] / w;
//			sima->cursor[1] = values[1] / h;
//		}
//	}
//
//	static void rna_SpaceImageEditor_curves_update(Main *bmain, Scene *scene, PointerRNA *ptr)
//	{
//		SpaceImage *sima= (SpaceImage*)ptr->data;
//		ImBuf *ibuf;
//		void *lock;
//
//		ibuf= ED_space_image_acquire_buffer(sima, &lock);
//		if(ibuf->rect_float)
//			curvemapping_do_ibuf(sima->cumap, ibuf);
//		ED_space_image_release_buffer(sima, lock);
//
//		WM_main_add_notifier(NC_IMAGE, sima->image);
//	}
//
//	static void rna_SpaceImageEditor_scopes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
//	{
//		SpaceImage *sima= (SpaceImage*)ptr->data;
//		ImBuf *ibuf;
//		void *lock;
//		
//		ibuf= ED_space_image_acquire_buffer(sima, &lock);
//		if(ibuf) {
//			scopes_update(&sima->scopes, ibuf, scene->r.color_mgt_flag & R_COLOR_MANAGEMENT);
//			WM_main_add_notifier(NC_IMAGE, sima->image);
//		}
//		ED_space_image_release_buffer(sima, lock);
//	}
//
//	/* Space Text Editor */
//
//	static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value)
//	{
//		SpaceText *st= (SpaceText*)(ptr->data);
//
//		st->wordwrap= value;
//		st->left= 0;
//	}
//
//	static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value)
//	{
//		SpaceText *st= (SpaceText*)(ptr->data);
//
//		st->text= value.data;
//		st->top= 0;
//	}

	/* Space Properties */

	/* note: this function exists only to avoid id refcounting */
	public static PropPointerSetFunc rna_SpaceProperties_pin_id_set = new PropPointerSetFunc() {
	public void setPtr(PointerRNA ptr, PointerRNA value)
	{
//	    SpaceButs *sbuts= (SpaceButs*)(ptr->data);
//	    sbuts->pinid= value.data;
	}};

	public static PropPointerTypeFunc rna_SpaceProperties_pin_id_typef = new PropPointerTypeFunc() {
	public StructRNA typePtr(PointerRNA ptr)
	{
//		SpaceButs *sbuts= (SpaceButs*)(ptr->data);
//
//		if(sbuts->pinid)
//			return ID_code_to_RNA_type(GS(sbuts->pinid->name));
//
//		return &RNA_ID;
		return null;
	}};

	public static UpdateFunc rna_SpaceProperties_pin_id_update = new UpdateFunc() {
    public void update(bContext C, PointerRNA ptr)
	{
//		SpaceButs *sbuts= (SpaceButs*)(ptr->data);
//		ID *id = sbuts->pinid;
//		
//		if (id == NULL) {
//			sbuts->flag &= ~SB_PIN_CONTEXT;
//			return;
//		}
//		
//		switch (GS(id->name)) {
//			case ID_MA:
//				WM_main_add_notifier(NC_MATERIAL|ND_SHADING, NULL);
//				break;
//			case ID_TE:
//				WM_main_add_notifier(NC_TEXTURE, NULL);
//				break;
//			case ID_WO:
//				WM_main_add_notifier(NC_WORLD, NULL);
//				break;
//			case ID_LA:
//				WM_main_add_notifier(NC_LAMP, NULL);
//				break;
//		}
	}};


	public static PropEnumSetFunc rna_SpaceProperties_align_set = new PropEnumSetFunc() {
	public void setEnum(PointerRNA ptr, int value)
	{
//		SpaceButs *sbuts= (SpaceButs*)(ptr->data);
//
//		sbuts->align= value;
//		sbuts->re_align= 1;
	}};

//	/* Space Console */
//	static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value)
//	{
//		ConsoleLine *ci= (ConsoleLine*)ptr->data;
//		strcpy(value, ci->line);
//	}
//
//	static int rna_ConsoleLine_body_length(PointerRNA *ptr)
//	{
//		ConsoleLine *ci= (ConsoleLine*)ptr->data;
//		return ci->len;
//	}
//
//	static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value)
//	{
//		ConsoleLine *ci= (ConsoleLine*)ptr->data;
//		int len= strlen(value);
//		
//		if((len >= ci->len_alloc) || (len * 2 < ci->len_alloc) ) { /* allocate a new strnig */
//			MEM_freeN(ci->line);
//			ci->line= MEM_mallocN((len + 1) * sizeof(char), "rna_consoleline");
//			ci->len_alloc= len + 1;
//		}
//
//		memcpy(ci->line, value, len + 1);
//		ci->len= len;
//
//		if(ci->cursor > len) /* clamp the cursor */
//			ci->cursor= len;
//	}
//
//	static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *max)
//	{
//		ConsoleLine *ci= (ConsoleLine*)ptr->data;
//
//		*min= 0;
//		*max= ci->len;
//	}
//
//	/* Space Time */
//
//	static void rna_SpaceTime_redraw_update(Main *bmain, Scene *scene, PointerRNA *ptr)
//	{
//		SpaceTime *st= (SpaceTime*)ptr->data;
//		bScreen *screen= (bScreen*)ptr->id.data;
//
//		ED_screen_animation_timer_update(screen, st->redraws, SPACE_TIME);
//	}
//
//	/* Space Dopesheet */
//
//	static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA value)
//	{
//		SpaceAction *saction= (SpaceAction*)(ptr->data);
//		saction->action= value.data;
//	}
//
//	static void rna_SpaceDopeSheetEditor_action_update(Main *bmain, Scene *scene, PointerRNA *ptr)
//	{
//		SpaceAction *saction= (SpaceAction*)(ptr->data);
//		Object *obact= (scene->basact)? scene->basact->object: NULL;
//
//		/* we must set this action to be the one used by active object (if not pinned) */
//		if (obact/* && saction->pin == 0*/) {
//			AnimData *adt = NULL;
//			
//			if (saction->mode == SACTCONT_ACTION) {
//				// TODO: context selector could help decide this with more control?
//				adt= BKE_id_add_animdata(&obact->id); /* this only adds if non-existant */
//			}
//			else if (saction->mode == SACTCONT_SHAPEKEY) {
//				Key *key = ob_get_key(obact);
//				if (key)
//					adt= BKE_id_add_animdata(&key->id); /* this only adds if non-existant */
//			}
//			
//			/* set action */
//			if (adt) {
//				/* fix id-count of action we're replacing */
//				id_us_min(&adt->action->id);
//				
//				/* show new id-count of action we're replacing */
//				adt->action= saction->action;
//				id_us_plus(&adt->action->id);
//			}
//			
//			/* force depsgraph flush too */
//			DAG_id_tag_update(&obact->id, OB_RECALC_OB|OB_RECALC_DATA);
//		}
//	}
//
//	static void rna_SpaceDopeSheetEditor_mode_update(Main *bmain, Scene *scene, PointerRNA *ptr)
//	{
//		SpaceAction *saction= (SpaceAction*)(ptr->data);
//		Object *obact= (scene->basact)? scene->basact->object: NULL;
//		
//		/* special exceptions for ShapeKey Editor mode */
//		if (saction->mode == SACTCONT_SHAPEKEY) {
//			Key *key = ob_get_key(obact);
//			
//			/* 1)	update the action stored for the editor */
//			if (key)
//				saction->action = (key->adt)? key->adt->action : NULL;
//			else
//				saction->action = NULL;
//			
//			/* 2)	enable 'show sliders' by default, since one of the main
//			 *		points of the ShapeKey Editor is to provide a one-stop shop
//			 *		for controlling the shapekeys, whose main control is the value
//			 */
//			saction->flag |= SACTION_SLIDERS;
//		}
//		/* make sure action stored is valid */
//		else if (saction->mode == SACTCONT_ACTION) {
//			/* 1)	update the action stored for the editor */
//			// TODO: context selector could help decide this with more control?
//			if (obact)
//				saction->action = (obact->adt)? obact->adt->action : NULL;
//			else
//				saction->action = NULL;
//		}
//	}
//
//	/* Space Graph Editor */
//
//	static void rna_SpaceGraphEditor_display_mode_update(bContext *C, PointerRNA *ptr)
//	{
//		//SpaceIpo *sipo= (SpaceIpo*)(ptr->data);
//		ScrArea *sa= CTX_wm_area(C);
//		
//		/* after changing view mode, must force recalculation of F-Curve colors 
//		 * which can only be achieved using refresh as opposed to redraw
//		 */
//		ED_area_tag_refresh(sa);
//	}
//
//	static int rna_SpaceGraphEditor_has_ghost_curves_get(PointerRNA *ptr)
//	{
//		SpaceIpo *sipo= (SpaceIpo*)(ptr->data);
//		return (sipo->ghostCurves.first != NULL);
//	}
//
//	static void rna_Sequencer_display_mode_update(bContext *C, PointerRNA *ptr)
//	{
//		int view = RNA_int_get(ptr, "view_type");
//
//		ED_sequencer_update_view(C, view);
//	}
//
//	static float rna_BackgroundImage_opacity_get(PointerRNA *ptr)
//	{
//		BGpic *bgpic= (BGpic *)ptr->data;
//		return 1.0f-bgpic->blend;
//	}
//
//	static void rna_BackgroundImage_opacity_set(PointerRNA *ptr, float value)
//	{
//		BGpic *bgpic= (BGpic *)ptr->data;
//		bgpic->blend = 1.0f - value;
//	}
//
//	#else

	static void rna_def_space(BlenderRNA brna)
	{
		StructRNA srna;
		PropertyRNA prop;
		
		srna= RNA_def_struct(brna, "Space", null);
		RNA_def_struct_sdna(srna, "SpaceLink");
		RNA_def_struct_ui_text(srna, "Space", "Space data for a screen area");
		RNA_def_struct_refine_func(srna, "rna_Space_refine");
		
		prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
		RNA_def_property_enum_sdna(prop, null, "spacetype");
		RNA_def_property_enum_items(prop, space_type_items);
		RNA_def_property_clear_flag(prop, PROP_EDITABLE);
		RNA_def_property_ui_text(prop, "Type", "Space data type");
	}

//	static void rna_def_space_image_uv(BlenderRNA *brna)
//	{
//		StructRNA *srna;
//		PropertyRNA *prop;
//
//		static EnumPropertyItem sticky_mode_items[] = {
//			{SI_STICKY_DISABLE, "DISABLED", ICON_STICKY_UVS_DISABLE, "Disabled", "Sticky vertex selection disabled"},
//			{SI_STICKY_LOC, "SHARED_LOCATION", ICON_STICKY_UVS_LOC, "Shared Location", "Select UVs that are at the same location and share a mesh vertex"},
//			{SI_STICKY_VERTEX, "SHARED_VERTEX", ICON_STICKY_UVS_VERT, "Shared Vertex", "Select UVs that share mesh vertex, irrespective if they are in the same location"},
//			{0, NULL, 0, NULL, NULL}};
//
//		static EnumPropertyItem dt_uv_items[] = {
//			{SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Draw white edges with black outline"},
//			{SI_UVDT_DASH, "DASH", 0, "Dash", "Draw dashed black-white edges"},
//			{SI_UVDT_BLACK, "BLACK", 0, "Black", "Draw black edges"},
//			{SI_UVDT_WHITE, "WHITE", 0, "White", "Draw white edges"},
//			{0, NULL, 0, NULL, NULL}};
//
//		static EnumPropertyItem dt_uvstretch_items[] = {
//			{SI_UVDT_STRETCH_ANGLE, "ANGLE", 0, "Angle", "Angular distortion between UV and 3D angles"},
//			{SI_UVDT_STRETCH_AREA, "AREA", 0, "Area", "Area distortion between UV and 3D faces"},
//			{0, NULL, 0, NULL, NULL}};
//
//		static EnumPropertyItem pivot_items[] = {
//			{V3D_CENTER, "CENTER", ICON_ROTATE, "Bounding Box Center", ""},
//			{V3D_CENTROID, "MEDIAN", ICON_ROTATECENTER, "Median Point", ""},
//			{V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
//			{0, NULL, 0, NULL, NULL}};
//
//		srna= RNA_def_struct(brna, "SpaceUVEditor", NULL);
//		RNA_def_struct_sdna(srna, "SpaceImage");
//		RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
//		RNA_def_struct_ui_text(srna, "Space UV Editor", "UV editor data for the image editor space");
//
//		/* selection */
//		prop= RNA_def_property(srna, "sticky_select_mode", PROP_ENUM, PROP_NONE);
//		RNA_def_property_enum_sdna(prop, NULL, "sticky");
//		RNA_def_property_enum_items(prop, sticky_mode_items);
//		RNA_def_property_ui_text(prop, "Sticky Selection Mode", "Automatically select also UVs sharing the same vertex as the ones being selected");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
//
//		/* drawing */
//		prop= RNA_def_property(srna, "edge_draw_type", PROP_ENUM, PROP_NONE);
//		RNA_def_property_enum_sdna(prop, NULL, "dt_uv");
//		RNA_def_property_enum_items(prop, dt_uv_items);
//		RNA_def_property_ui_text(prop, "Edge Draw Type", "Draw type for drawing UV edges");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
//
//		prop= RNA_def_property(srna, "show_smooth_edges", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SMOOTH_UV);
//		RNA_def_property_ui_text(prop, "Draw Smooth Edges", "Draw UV edges anti-aliased");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
//
//		prop= RNA_def_property(srna, "show_stretch", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_STRETCH);
//		RNA_def_property_ui_text(prop, "Draw Stretch", "Draw faces colored according to the difference in shape between UVs and their 3D coordinates (blue for low distortion, red for high distortion)");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
//
//		prop= RNA_def_property(srna, "draw_stretch_type", PROP_ENUM, PROP_NONE);
//		RNA_def_property_enum_sdna(prop, NULL, "dt_uvstretch");
//		RNA_def_property_enum_items(prop, dt_uvstretch_items);
//		RNA_def_property_ui_text(prop, "Draw Stretch Type", "Type of stretch to draw");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
//
//		prop= RNA_def_property(srna, "show_modified_edges", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWSHADOW);
//		RNA_def_property_ui_text(prop, "Draw Modified Edges", "Draw edges after modifiers are applied");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
//
//		prop= RNA_def_property(srna, "show_other_objects", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_OTHER);
//		RNA_def_property_ui_text(prop, "Draw Other Objects", "Draw other selected objects that share the same image");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
//
//		prop= RNA_def_property(srna, "show_normalized_coords", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS);
//		RNA_def_property_ui_text(prop, "Normalized Coordinates", "Display UV coordinates from 0.0 to 1.0 rather than in pixels");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
//		
//		prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_NONE);
//		RNA_def_property_array(prop, 2);
//		RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_cursor_location_get", "rna_SpaceImageEditor_cursor_location_set", NULL);
//		RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
//
//		/* todo: move edge and face drawing options here from G.f */
//
//		prop= RNA_def_property(srna, "use_snap_to_pixels", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_PIXELSNAP);
//		RNA_def_property_ui_text(prop, "Snap to Pixels", "Snap UVs to pixel locations while editing");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
//
//		prop= RNA_def_property(srna, "lock_bounds", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_CLIP_UV);
//		RNA_def_property_ui_text(prop, "Constrain to Image Bounds", "Constraint to stay within the image bounds while editing");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
//
//		prop= RNA_def_property(srna, "use_live_unwrap", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LIVE_UNWRAP);
//		RNA_def_property_ui_text(prop, "Live Unwrap", "Continuously unwrap the selected UV island while transforming pinned vertices");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
//
//		prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
//		RNA_def_property_enum_sdna(prop, NULL, "around");
//		RNA_def_property_enum_items(prop, pivot_items);
//		RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
//	}

	public static EnumPropertyItem[] display_mode_items = {
		new EnumPropertyItem(SO_ALL_SCENES, "ALL_SCENES", 0, "All Scenes", ""),
		new EnumPropertyItem(SO_CUR_SCENE, "CURRENT_SCENE", 0, "Current Scene", ""),
		new EnumPropertyItem(SO_VISIBLE, "VISIBLE_LAYERS", 0, "Visible Layers", ""),
		new EnumPropertyItem(SO_SELECTED, "SELECTED", 0, "Selected", ""),
		new EnumPropertyItem(SO_ACTIVE, "ACTIVE", 0, "Active", ""),
		new EnumPropertyItem(SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types", ""),
		new EnumPropertyItem(SO_GROUPS, "GROUPS", 0, "Groups", ""),
		new EnumPropertyItem(SO_LIBRARIES, "LIBRARIES", 0, "Libraries", ""),
		new EnumPropertyItem(SO_SEQUENCE, "SEQUENCE", 0, "Sequence", ""),
		new EnumPropertyItem(SO_DATABLOCKS, "DATABLOCKS", 0, "Datablocks", ""),
		new EnumPropertyItem(SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", ""),
		new EnumPropertyItem(SO_KEYMAP, "KEYMAPS", 0, "Key Maps", ""),
		new EnumPropertyItem(0, null, 0, null, null)};
	public static void rna_def_space_outliner(BlenderRNA brna)
	{
		StructRNA srna;
		PropertyRNA prop;

//		static EnumPropertyItem display_mode_items[] = {
//			{SO_ALL_SCENES, "ALL_SCENES", 0, "All Scenes", ""},
//			{SO_CUR_SCENE, "CURRENT_SCENE", 0, "Current Scene", ""},
//			{SO_VISIBLE, "VISIBLE_LAYERS", 0, "Visible Layers", ""},
//			{SO_SELECTED, "SELECTED", 0, "Selected", ""},
//			{SO_ACTIVE, "ACTIVE", 0, "Active", ""},
//			{SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types", ""},
//			{SO_GROUPS, "GROUPS", 0, "Groups", ""},
//			{SO_LIBRARIES, "LIBRARIES", 0, "Libraries", ""},
//			{SO_SEQUENCE, "SEQUENCE", 0, "Sequence", ""},
//			{SO_DATABLOCKS, "DATABLOCKS", 0, "Datablocks", ""},
//			{SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", ""},
//			{SO_KEYMAP, "KEYMAPS", 0, "Key Maps", ""},
//			{0, NULL, 0, NULL, NULL}};
		
		srna= RnaDefine.RNA_def_struct(brna, "SpaceOutliner", "Space");
		RnaDefine.RNA_def_struct_sdna(srna, "SpaceOops");
		RnaDefine.RNA_def_struct_ui_text(srna, "Space Outliner", "Outliner space data");
		
		prop= RnaDefine.RNA_def_property(srna, "display_mode", RNATypes.PROP_ENUM, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_enum_sdna(prop, null, "outlinevis");
		RnaDefine.RNA_def_property_enum_items(prop, display_mode_items);
		RnaDefine.RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display");
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, null);
		
		prop= RnaDefine.RNA_def_property(srna, "filter_text", RNATypes.PROP_STRING, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_string_sdna(prop, null, "search_string");
		RnaDefine.RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string");
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, null);
		
		prop= RnaDefine.RNA_def_property(srna, "use_filter_case_sensitive", RNATypes.PROP_BOOLEAN, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_boolean_sdna(prop, null, "search_flags", SO_FIND_CASE_SENSITIVE);
		RnaDefine.RNA_def_property_ui_text(prop, "Case Sensitive Matches Only", "Only use case sensitive matches of search string");
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, null);
		
		prop= RnaDefine.RNA_def_property(srna, "use_filter_complete", RNATypes.PROP_BOOLEAN, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_boolean_sdna(prop, null, "search_flags", SO_FIND_COMPLETE);
		RnaDefine.RNA_def_property_ui_text(prop, "Complete Matches Only", "Only use complete matches of search string");
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, null);
		
		prop= RnaDefine.RNA_def_property(srna, "show_restrict_columns", RNATypes.PROP_BOOLEAN, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_boolean_negative_sdna(prop, null, "flag", SO_HIDE_RESTRICTCOLS);
		RnaDefine.RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show column");
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, null);
	}

//	static void rna_def_background_image(BlenderRNA *brna)
//	{
//		StructRNA *srna;
//		PropertyRNA *prop;
//
//		/* note: combinations work but dont flip so arnt that useful */
//		static EnumPropertyItem bgpic_axis_items[] = {
//			{0, "", 0, "X Axis", ""},
//			{(1<<RV3D_VIEW_LEFT), "LEFT", 0, "Left", ""},
//			{(1<<RV3D_VIEW_RIGHT), "RIGHT", 0, "Right", ""},
//			/*{(1<<RV3D_VIEW_LEFT)|(1<<RV3D_VIEW_RIGHT), "LEFT_RIGHT", 0, "Left/Right", ""},*/
//			{0, "", 0, "Y Axis", ""},
//			{(1<<RV3D_VIEW_BACK), "BACK", 0, "Back", ""},
//			{(1<<RV3D_VIEW_FRONT), "FRONT", 0, "Front", ""},
//			/*{(1<<RV3D_VIEW_BACK)|(1<<RV3D_VIEW_FRONT), "BACK_FRONT", 0, "Back/Front", ""},*/
//			{0, "", 0, "Z Axis", ""},
//			{(1<<RV3D_VIEW_BOTTOM), "BOTTOM", 0, "Bottom", ""},
//			{(1<<RV3D_VIEW_TOP), "TOP", 0, "Top", ""},
//			/*{(1<<RV3D_VIEW_BOTTOM)|(1<<RV3D_VIEW_TOP), "BOTTOM_TOP", 0, "Top/Bottom", ""},*/
//			{0, "", 0, "Other", ""},
//			{0, "ALL", 0, "All Views", ""},
//			{(1<<RV3D_VIEW_CAMERA), "CAMERA", 0, "Camera", ""},
//			{0, NULL, 0, NULL, NULL}};
//
//		srna= RNA_def_struct(brna, "BackgroundImage", NULL);
//		RNA_def_struct_sdna(srna, "BGpic");
//		RNA_def_struct_ui_text(srna, "Background Image", "Image and settings for display in the 3d View background");
//
//		prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
//		RNA_def_property_pointer_sdna(prop, NULL, "ima");
//		RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
//		RNA_def_property_flag(prop, PROP_EDITABLE);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
//
//		prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
//		RNA_def_property_flag(prop, PROP_NEVER_NULL);
//		RNA_def_property_pointer_sdna(prop, NULL, "iuser");
//		RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
//		
//		prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
//		RNA_def_property_float_sdna(prop, NULL, "xof");
//		RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the world origin");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
//		
//		prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
//		RNA_def_property_float_sdna(prop, NULL, "yof");
//		RNA_def_property_ui_text(prop, "Y Offset", "Offsets image vertically from the world origin");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
//		
//		prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
//		RNA_def_property_float_sdna(prop, NULL, "size");
//		RNA_def_property_ui_text(prop, "Size", "Scaling factor for the background image");
//		RNA_def_property_range(prop, 0.0, FLT_MAX);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
//		
//		prop= RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE);
//		RNA_def_property_float_sdna(prop, NULL, "blend");
//		RNA_def_property_float_funcs(prop, "rna_BackgroundImage_opacity_get", "rna_BackgroundImage_opacity_set", NULL);
//		RNA_def_property_ui_text(prop, "Opacity", "Image opacity to blend the image against the background color");
//		RNA_def_property_range(prop, 0.0, 1.0);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
//
//		prop= RNA_def_property(srna, "view_axis", PROP_ENUM, PROP_NONE);
//		RNA_def_property_enum_sdna(prop, NULL, "view");
//		RNA_def_property_enum_items(prop, bgpic_axis_items);
//		RNA_def_property_ui_text(prop, "Image Axis", "The axis to display the image on");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
//
//		prop= RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_EXPANDED);
//		RNA_def_property_ui_text(prop, "Show Expanded", "Show the expanded in the user interface");
//		RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
//
//	}
	
	static EnumPropertyItem[] pivot_items = {
		new EnumPropertyItem(View3dTypes.V3D_CENTER, "BOUNDING_BOX_CENTER", BIFIconID.ICON_ROTATE.ordinal(), "Bounding Box Center", ""),
		new EnumPropertyItem(View3dTypes.V3D_CURSOR, "CURSOR", BIFIconID.ICON_CURSOR.ordinal(), "3D Cursor", ""),
		new EnumPropertyItem(View3dTypes.V3D_LOCAL, "INDIVIDUAL_ORIGINS", BIFIconID.ICON_ROTATECOLLECTION.ordinal(), "Individual Origins", ""),
		new EnumPropertyItem(View3dTypes.V3D_CENTROID, "MEDIAN_POINT", BIFIconID.ICON_ROTATECENTER.ordinal(), "Median Point", ""),
		new EnumPropertyItem(View3dTypes.V3D_ACTIVE, "ACTIVE_ELEMENT", BIFIconID.ICON_ROTACTIVE.ordinal(), "Active Element", ""),
		new EnumPropertyItem(0, null, 0, null, null)};

	static EnumPropertyItem[] rv3d_persp_items = {
		new EnumPropertyItem(View3dTypes.RV3D_PERSP, "PERSP", 0, "Perspective", ""),
		new EnumPropertyItem(View3dTypes.RV3D_ORTHO, "ORTHO", 0, "Orthographic", ""),
		new EnumPropertyItem(View3dTypes.RV3D_CAMOB, "CAMERA", 0, "Camera", ""),
		new EnumPropertyItem(0, null, 0, null, null)};


	static void rna_def_space_view3d(BlenderRNA brna)
	{
		StructRNA srna;
		PropertyRNA prop;
		final int[] matrix_dimsize= {4, 4};
			
//		static EnumPropertyItem pivot_items[] = {
//			{V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""},
//			{V3D_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", ""},
//			{V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Origins", ""},
//			{V3D_CENTROID, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point", ""},
//			{V3D_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", ""},
//			{0, NULL, 0, NULL, NULL}};
//
//		static EnumPropertyItem rv3d_persp_items[] = {
//			{RV3D_PERSP, "PERSP", 0, "Perspective", ""},
//			{RV3D_ORTHO, "ORTHO", 0, "Orthographic", ""},
//			{RV3D_CAMOB, "CAMERA", 0, "Camera", ""},
//			{0, NULL, 0, NULL, NULL}};
		
		srna= RNA_def_struct(brna, "SpaceView3D", "Space");
		RNA_def_struct_sdna(srna, "View3D");
		RNA_def_struct_ui_text(srna, "3D View Space", "3D View space data");
		
		prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE);
		RNA_def_property_flag(prop, PROP_EDITABLE);
		RNA_def_property_pointer_sdna(prop, null, "camera");
		RNA_def_property_ui_text(prop, "Camera", "Active camera used in this view (when unlocked from the scene's active camera)");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE);
		RNA_def_property_flag(prop, PROP_EDITABLE);
		RNA_def_property_pointer_sdna(prop, null, "ob_centre");
		RNA_def_property_ui_text(prop, "Lock to Object", "3D View center is locked to this object's position");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "lock_bone", PROP_STRING, PROP_NONE);
		RNA_def_property_string_sdna(prop, null, "ob_centre_bone");
		RNA_def_property_ui_text(prop, "Lock to Bone", "3D View center is locked to this bone's position");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);

		prop= RNA_def_property(srna, "lock_cursor", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "ob_centre_cursor", 1);
		RNA_def_property_ui_text(prop, "Lock to Cursor", "3D View center is locked to the cursor's position");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);

		prop= RNA_def_property(srna, "viewport_shade", PROP_ENUM, PROP_NONE);
		RNA_def_property_enum_sdna(prop, null, "drawtype");
		RNA_def_property_enum_items(prop, viewport_shade_items);
		RNA_def_property_ui_text(prop, "Viewport Shading", "Method to display/shade objects in the 3D View");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);

		prop= RNA_def_property(srna, "local_view", PROP_POINTER, PROP_NONE);
		RNA_def_property_pointer_sdna(prop, null, "localvd");
		RNA_def_property_ui_text(prop, "Local View", "Display an isolated sub-set of objects, apart from the scene visibility");
		
		prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
		RNA_def_property_array(prop, 3);
		RNA_def_property_float_funcs(prop, "rna_View3D_CursorLocation_get", "rna_View3D_CursorLocation_set", null);
		RNA_def_property_ui_text(prop, "3D Cursor Location", "3D cursor location for this view (dependent on local view setting)");
		RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
		RNA_def_property_float_sdna(prop, null, "lens");
		RNA_def_property_ui_text(prop, "Lens", "Lens angle (mm) in perspective view");
		RNA_def_property_range(prop, 1.0f, 250.0f);
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
		RNA_def_property_float_sdna(prop, null, "near");
		RNA_def_property_range(prop, 0.0f, FLT_MAX);
		RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping distance");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);

		prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
		RNA_def_property_float_sdna(prop, null, "far");
		RNA_def_property_range(prop, 1.0f, FLT_MAX);
		RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distance");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);

		prop= RNA_def_property(srna, "grid_scale", PROP_FLOAT, PROP_NONE);
		RNA_def_property_float_sdna(prop, null, "grid");
		RNA_def_property_ui_text(prop, "Grid Scale", "The distance between 3D View grid lines");
		RNA_def_property_range(prop, 0.0f, FLT_MAX);
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);

		prop= RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE);
		RNA_def_property_int_sdna(prop, null, "gridlines");
		RNA_def_property_ui_text(prop, "Grid Lines", "The number of grid lines to display in perspective view");
		RNA_def_property_range(prop, 0, 1024);
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE);
		RNA_def_property_int_sdna(prop, null, "gridsubdiv");
		RNA_def_property_ui_text(prop, "Grid Subdivisions", "The number of subdivisions between grid lines");
		RNA_def_property_range(prop, 1, 1024);
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "gridflag", View3dTypes.V3D_SHOW_FLOOR);
		RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid in perspective view");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "show_axis_x", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "gridflag", View3dTypes.V3D_SHOW_X);
		RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line in perspective view");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "show_axis_y", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "gridflag", View3dTypes.V3D_SHOW_Y);
		RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line in perspective view");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "show_axis_z", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "gridflag", View3dTypes.V3D_SHOW_Z);
		RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line in perspective view");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "show_outline_selected", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "flag", View3dTypes.V3D_SELECT_OUTLINE);
		RNA_def_property_ui_text(prop, "Outline Selected", "Show an outline highlight around selected objects in non-wireframe views");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "show_all_objects_origin", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "flag", View3dTypes.V3D_DRAW_CENTERS);
		RNA_def_property_ui_text(prop, "All Object Origins", "Show the object origin center dot for all (selected and unselected) objects");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);

		prop= RNA_def_property(srna, "show_relationship_lines", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_negative_sdna(prop, null, "flag", View3dTypes.V3D_HIDE_HELPLINES);
		RNA_def_property_ui_text(prop, "Relationship Lines", "Show dashed lines indicating parent or constraint relationships");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "show_textured_solid", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "flag2", View3dTypes.V3D_SOLID_TEX);
		RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);

		prop= RNA_def_property(srna, "show_only_render", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "flag2", View3dTypes.V3D_RENDER_OVERRIDE);
		RNA_def_property_ui_text(prop, "Only Render", "Display only objects which will be rendered");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "use_occlude_geometry", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "flag", View3dTypes.V3D_ZBUF_SELECT);
		RNA_def_property_ui_text(prop, "Occlude Geometry", "Limit selection to visible (clipped with depth buffer)");
		RNA_def_property_ui_icon(prop, BIFIconID.ICON_ORTHO.ordinal(), 0);
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);

		prop= RNA_def_property(srna, "background_images", PROP_COLLECTION, PROP_NONE);
		RNA_def_property_collection_sdna(prop, null, "bgpicbase", null);
		RNA_def_property_struct_type(prop, "BackgroundImage");
		RNA_def_property_ui_text(prop, "Background Images", "List of background images");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);

		prop= RNA_def_property(srna, "show_background_images", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "flag", View3dTypes.V3D_DISPBGPICS);
		RNA_def_property_ui_text(prop, "Display Background Images", "Display reference images behind objects in the 3D View");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);

		prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
		RNA_def_property_enum_sdna(prop, null, "around");
		RNA_def_property_enum_items(prop, pivot_items);
		RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "use_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "flag", View3dTypes.V3D_ALIGN);
		RNA_def_property_ui_text(prop, "Align", "Manipulate object centers only");
		RNA_def_property_ui_icon(prop, BIFIconID.ICON_ALIGN.ordinal(), 0);
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);

		prop= RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "twflag", View3dTypes.V3D_USE_MANIPULATOR);
		RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms");
		RNA_def_property_ui_icon(prop, BIFIconID.ICON_MANIPUL.ordinal(), 0);
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "use_manipulator_translate", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "twtype", View3dTypes.V3D_MANIP_TRANSLATE);
		RNA_def_property_ui_text(prop, "Manipulator Translate", "Use the manipulator for movement transformations");
		RNA_def_property_ui_icon(prop, BIFIconID.ICON_MAN_TRANS.ordinal(), 0);
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "use_manipulator_rotate", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "twtype", View3dTypes.V3D_MANIP_ROTATE);
		RNA_def_property_ui_text(prop, "Manipulator Rotate", "Use the manipulator for rotation transformations");
		RNA_def_property_ui_icon(prop, BIFIconID.ICON_MAN_ROT.ordinal(), 0);
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "use_manipulator_scale", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "twtype", View3dTypes.V3D_MANIP_SCALE);
		RNA_def_property_ui_text(prop, "Manipulator Scale", "Use the manipulator for scale transformations");
		RNA_def_property_ui_icon(prop, BIFIconID.ICON_MAN_SCALE.ordinal(), 0);
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE);
		RNA_def_property_enum_sdna(prop, null, "twmode");
		RNA_def_property_enum_items(prop, transform_orientation_items);
		RNA_def_property_enum_funcs(prop, null, null, "rna_TransformOrientation_itemf");
		RNA_def_property_ui_text(prop, "Transform Orientation", "Transformation orientation");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);

		prop= RNA_def_property(srna, "current_orientation", PROP_POINTER, PROP_NONE);
		RNA_def_property_struct_type(prop, "TransformOrientation");
		RNA_def_property_pointer_funcs(prop, "rna_CurrentOrientation_get", null, null, null);
		RNA_def_property_ui_text(prop, "Current Transform Orientation", "Current Transformation orientation");

		prop= RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "scenelock", 1);
		RNA_def_property_boolean_funcs(prop, null, "rna_SpaceView3D_lock_camera_and_layers_set");
		RNA_def_property_ui_text(prop, "Lock Camera and Layers", "Use the scene's active camera and layers in this view, rather than local layers");
		RNA_def_property_ui_icon(prop, BIFIconID.ICON_LOCKVIEW_OFF.ordinal(), 1);
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);

		prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER);
		RNA_def_property_boolean_sdna(prop, null, "lay", 1);
		RNA_def_property_array(prop, 20);
		RNA_def_property_boolean_funcs(prop, null, "rna_SpaceView3D_layer_set");
		RNA_def_property_ui_text(prop, "Visible Layers", "Layers visible in this 3D View");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "layers_used", PROP_BOOLEAN, PROP_LAYER_MEMBER);
		RNA_def_property_boolean_sdna(prop, null, "lay_used", 1);
		RNA_def_property_array(prop, 20);
		RNA_def_property_clear_flag(prop, PROP_EDITABLE);
		RNA_def_property_ui_text(prop, "Used Layers", "Layers that contain something");

		prop= RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE);
		RNA_def_property_struct_type(prop, "RegionView3D");
		RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", null, null, null);
		RNA_def_property_ui_text(prop, "3D Region", "3D region in this space, in case of quad view the camera region");

		prop= RNA_def_property(srna, "region_quadview", PROP_POINTER, PROP_NONE);
		RNA_def_property_struct_type(prop, "RegionView3D");
		RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_quadview_get", null, null, null);
		RNA_def_property_ui_text(prop, "Quad View Region", "3D region that defines the quad view settings");

		/* region */

		srna= RNA_def_struct(brna, "RegionView3D", null);
		RNA_def_struct_sdna(srna, "RegionView3D");
		RNA_def_struct_ui_text(srna, "3D View Region", "3D View region data");

		prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "viewlock", View3dTypes.RV3D_LOCKED);
		RNA_def_property_ui_text(prop, "Lock", "Lock view rotation in side views");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
		
		prop= RNA_def_property(srna, "show_sync_view", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "viewlock", View3dTypes.RV3D_BOXVIEW);
		RNA_def_property_ui_text(prop, "Box", "Sync view position between side views");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_update");
		
		prop= RNA_def_property(srna, "use_box_clip", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "viewlock", View3dTypes.RV3D_BOXCLIP);
		RNA_def_property_ui_text(prop, "Clip", "Clip objects based on what's visible in other side views");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_RegionView3D_quadview_clip_update");
		
		prop= RNA_def_property(srna, "perspective_matrix", PROP_FLOAT, PROP_MATRIX);
		RNA_def_property_float_sdna(prop, null, "persmat");
		RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX: for now, it's too risky for users to do this
		RNA_def_property_multi_array(prop, 2, matrix_dimsize);
		RNA_def_property_ui_text(prop, "Perspective Matrix", "Current perspective matrix of the 3D region");
		
		prop= RNA_def_property(srna, "view_matrix", PROP_FLOAT, PROP_MATRIX);
		RNA_def_property_float_sdna(prop, null, "viewmat");
		RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX: for now, it's too risky for users to do this
		RNA_def_property_multi_array(prop, 2, matrix_dimsize);
		RNA_def_property_ui_text(prop, "View Matrix", "Current view matrix of the 3D region");

		prop= RNA_def_property(srna, "view_perspective", PROP_ENUM, PROP_NONE);
		RNA_def_property_enum_sdna(prop, null, "persp");
		RNA_def_property_enum_items(prop, rv3d_persp_items);
		RNA_def_property_ui_text(prop, "Perspective", "View Perspective");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		prop= RNA_def_property(srna, "view_location", PROP_FLOAT, PROP_TRANSLATION);
//	#if 0
//		RNA_def_property_float_sdna(prop, NULL, "ofs"); // cant use because its negated
//	#else
		RNA_def_property_array(prop, 3);
		RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_location_get", "rna_RegionView3D_view_location_set", null);
//	#endif
		RNA_def_property_ui_text(prop, "View Location", "View pivot location");
		RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4);
		RNA_def_property_update(prop, NC_WINDOW, null);
		
		prop= RNA_def_property(srna, "view_rotation", PROP_FLOAT, PROP_QUATERNION);
		RNA_def_property_float_sdna(prop, null, "viewquat");
		RNA_def_property_ui_text(prop, "View Rotation", "Rotation in quaternions (keep normalized)");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
		
		/* not sure we need rna access to these but adding anyway */
		prop= RNA_def_property(srna, "view_distance", PROP_FLOAT, PROP_UNSIGNED);
		RNA_def_property_float_sdna(prop, null, "dist");
		RNA_def_property_ui_text(prop, "Distance", "Distance to the view location");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, null);
	}

	static void rna_def_space_buttons(BlenderRNA brna)
	{
		StructRNA srna;
		PropertyRNA prop;

		EnumPropertyItem[] buttons_context_items = {
			new EnumPropertyItem(BCONTEXT_SCENE, "SCENE", BIFIconID.ICON_SCENE.ordinal(), "Scene", "Scene"),
			new EnumPropertyItem(BCONTEXT_RENDER, "RENDER", BIFIconID.ICON_SCENE_DATA.ordinal(), "Render", "Render"),
			new EnumPropertyItem(BCONTEXT_WORLD, "WORLD", BIFIconID.ICON_WORLD.ordinal(), "World", "World"),
			new EnumPropertyItem(BCONTEXT_OBJECT, "OBJECT", BIFIconID.ICON_OBJECT_DATA.ordinal(), "Object", "Object"),
			new EnumPropertyItem(BCONTEXT_CONSTRAINT, "CONSTRAINT", BIFIconID.ICON_CONSTRAINT.ordinal(), "Constraints", "Constraints"),
			new EnumPropertyItem(BCONTEXT_MODIFIER, "MODIFIER", BIFIconID.ICON_MODIFIER.ordinal(), "Modifiers", "Modifiers"),
			new EnumPropertyItem(BCONTEXT_DATA, "DATA", 0, "Data", "Data"),
			new EnumPropertyItem(BCONTEXT_BONE, "BONE", BIFIconID.ICON_BONE_DATA.ordinal(), "Bone", "Bone"),
			new EnumPropertyItem(BCONTEXT_BONE_CONSTRAINT, "BONE_CONSTRAINT", BIFIconID.ICON_CONSTRAINT.ordinal(), "Bone Constraints", "Bone Constraints"),
			new EnumPropertyItem(BCONTEXT_MATERIAL, "MATERIAL", BIFIconID.ICON_MATERIAL.ordinal(), "Material", "Material"),
			new EnumPropertyItem(BCONTEXT_TEXTURE, "TEXTURE", BIFIconID.ICON_TEXTURE.ordinal(), "Texture", "Texture"),
			new EnumPropertyItem(BCONTEXT_PARTICLE, "PARTICLE", BIFIconID.ICON_PARTICLES.ordinal(), "Particle", "Particle"),
			new EnumPropertyItem(BCONTEXT_PHYSICS, "PHYSICS", BIFIconID.ICON_PHYSICS.ordinal(), "Physics", "Physics"),
			new EnumPropertyItem(0, null, 0, null, null)};
		
		EnumPropertyItem[] align_items = {
			new EnumPropertyItem(BUT_HORIZONTAL, "HORIZONTAL", 0, "Horizontal", ""),
			new EnumPropertyItem(BUT_VERTICAL, "VERTICAL", 0, "Vertical", ""),
			new EnumPropertyItem(0, null, 0, null, null)};
			
		srna= RNA_def_struct(brna, "SpaceProperties", "Space");
		RNA_def_struct_sdna(srna, "SpaceButs");
		RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data");
		
		prop= RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE);
		RNA_def_property_enum_sdna(prop, null, "mainb");
		RNA_def_property_enum_items(prop, buttons_context_items);
		RNA_def_property_ui_text(prop, "Context", "Type of active data to display and edit");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, null);
		
		prop= RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
		RNA_def_property_enum_sdna(prop, null, "align");
		RNA_def_property_enum_items(prop, align_items);
		RNA_def_property_enum_funcs(prop, null, "rna_SpaceProperties_align_set", null);
		RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, null);

		prop= RNA_def_property(srna, "show_brush_texture", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "flag", SB_BRUSH_TEX);
		RNA_def_property_ui_text(prop, "Brush Texture", "Show brush textures");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, null);

		/* pinned data */
		prop= RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE);
		RNA_def_property_pointer_sdna(prop, null, "pinid");
		RNA_def_property_struct_type(prop, "ID");
	    /* note: custom set function is ONLY to avoid rna setting a user for this. */
		RNA_def_property_pointer_funcs(prop, null, "rna_SpaceProperties_pin_id_set", "rna_SpaceProperties_pin_id_typef", null);
		RNA_def_property_flag(prop, PROP_EDITABLE);
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, "rna_SpaceProperties_pin_id_update");

		prop= RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "flag", SB_PIN_CONTEXT);
		RNA_def_property_ui_text(prop, "Pin ID", "Use the pinned context");
	}

//	static void rna_def_space_image(BlenderRNA *brna)
//	{
//		StructRNA *srna;
//		PropertyRNA *prop;
//
//		srna= RNA_def_struct(brna, "SpaceImageEditor", "Space");
//		RNA_def_struct_sdna(srna, "SpaceImage");
//		RNA_def_struct_ui_text(srna, "Space Image Editor", "Image and UV editor space data");
//
//		/* image */
//		prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
//		RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_set", NULL, NULL);
//		RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
//		RNA_def_property_flag(prop, PROP_EDITABLE);
//		RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL); // is handled in image editor too
//
//		prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE);
//		RNA_def_property_flag(prop, PROP_NEVER_NULL);
//		RNA_def_property_pointer_sdna(prop, NULL, "iuser");
//		RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
//
//		prop= RNA_def_property(srna, "curves", PROP_POINTER, PROP_NONE);
//		RNA_def_property_pointer_sdna(prop, NULL, "cumap");
//		RNA_def_property_ui_text(prop, "Curves", "Color curve mapping to use for displaying the image");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_curves_update");
//
//		prop= RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
//		RNA_def_property_pointer_sdna(prop, NULL, "scopes");
//		RNA_def_property_struct_type(prop, "Scopes");
//		RNA_def_property_ui_text(prop, "Scopes", "Scopes to visualize image statistics.");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_scopes_update");
//
//		prop= RNA_def_property(srna, "use_image_pin", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "pin", 0);
//		RNA_def_property_ui_text(prop, "Image Pin", "Display current image regardless of object selection");
//		RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
//
//		prop= RNA_def_property(srna, "sample_histogram", PROP_POINTER, PROP_NONE);
//		RNA_def_property_pointer_sdna(prop, NULL, "sample_line_hist");
//		RNA_def_property_struct_type(prop, "Histogram");
//		RNA_def_property_ui_text(prop, "Line sample", "Sampled colors along line");
//		
//		/* image draw */
//		prop= RNA_def_property(srna, "show_repeat", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_TILE);
//		RNA_def_property_ui_text(prop, "Draw Repeated", "Draw the image repeated outside of the main view");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
//
//		prop= RNA_def_property(srna, "draw_channels", PROP_ENUM, PROP_NONE);
//		RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
//		RNA_def_property_enum_items(prop, draw_channels_items);
//		RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceImageEditor_draw_channels_itemf");
//		RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL);
//
//		/* uv */
//		prop= RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NONE);
//		RNA_def_property_flag(prop, PROP_NEVER_NULL);
//		RNA_def_property_struct_type(prop, "SpaceUVEditor");
//		RNA_def_property_pointer_funcs(prop, "rna_SpaceImageEditor_uvedit_get", NULL, NULL, NULL);
//		RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings");
//		
//		/* paint */
//		prop= RNA_def_property(srna, "use_image_paint", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWTOOL);
//		RNA_def_property_ui_text(prop, "Image Painting", "Enable image painting mode");
//		RNA_def_property_ui_icon(prop, ICON_TPAINT_HLT, 0);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_paint_update");
//
//		/* grease pencil */
//		prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
//		RNA_def_property_pointer_sdna(prop, NULL, "gpd");
//		RNA_def_property_flag(prop, PROP_EDITABLE);
//		RNA_def_property_struct_type(prop, "GreasePencil");
//		RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space");
//
//		prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DISPGP);
//		RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay");
//
//		/* update */
//		prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "lock", 0);
//		RNA_def_property_ui_text(prop, "Update Automatically", "Update other affected window spaces automatically to reflect changes during interactive operations such as transform");
//
//		/* state */
//		prop= RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_render_get", NULL);
//		RNA_def_property_clear_flag(prop, PROP_EDITABLE);
//		RNA_def_property_ui_text(prop, "Show Render", "Show render related properties");
//
//		prop= RNA_def_property(srna, "show_paint", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_paint_get", NULL);
//		RNA_def_property_clear_flag(prop, PROP_EDITABLE);
//		RNA_def_property_ui_text(prop, "Show Paint", "Show paint related properties");
//
//		prop= RNA_def_property(srna, "show_uvedit", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_funcs(prop, "rna_SpaceImageEditor_show_uvedit_get", NULL);
//		RNA_def_property_clear_flag(prop, PROP_EDITABLE);
//		RNA_def_property_ui_text(prop, "Show UV Editor", "Show UV editing related properties");
//
//		rna_def_space_image_uv(brna);
//	}
//
//	static void rna_def_space_sequencer(BlenderRNA *brna)
//	{
//		StructRNA *srna;
//		PropertyRNA *prop;
//		
//		static EnumPropertyItem view_type_items[] = {
//			{SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
//			{SEQ_VIEW_PREVIEW,  "PREVIEW", ICON_SEQ_PREVIEW, "Image Preview", ""},
//			{SEQ_VIEW_SEQUENCE_PREVIEW,  "SEQUENCER_PREVIEW", ICON_SEQ_SPLITVIEW, "Sequencer and Image Preview", ""},
//			{0, NULL, 0, NULL, NULL}};
//
//		static EnumPropertyItem display_mode_items[] = {
//			{SEQ_DRAW_IMG_IMBUF, "IMAGE", ICON_SEQ_PREVIEW, "Image Preview", ""},
//			{SEQ_DRAW_IMG_WAVEFORM, "WAVEFORM", ICON_SEQ_LUMA_WAVEFORM, "Luma Waveform", ""},
//			{SEQ_DRAW_IMG_VECTORSCOPE, "VECTOR_SCOPE", ICON_SEQ_CHROMA_SCOPE, "Chroma Vectorscope", ""},
//			{SEQ_DRAW_IMG_HISTOGRAM, "HISTOGRAM", ICON_SEQ_HISTOGRAM, "Histogram", ""},
//			{0, NULL, 0, NULL, NULL}};
//
//		static EnumPropertyItem proxy_render_size_items[] = {
//			{SEQ_PROXY_RENDER_SIZE_NONE, "NONE", 0, "No display", ""},
//			{SEQ_PROXY_RENDER_SIZE_SCENE, "SCENE", 0, "Scene render size", ""},
//			{SEQ_PROXY_RENDER_SIZE_25, "PROXY_25", 0, "Proxy size 25%", ""},
//			{SEQ_PROXY_RENDER_SIZE_50, "PROXY_50", 0, "Proxy size 50%", ""},
//			{SEQ_PROXY_RENDER_SIZE_75, "PROXY_75", 0, "Proxy size 75%", ""},
//			{SEQ_PROXY_RENDER_SIZE_FULL, "FULL", 0, "No proxy, full render", ""},
//			{0, NULL, 0, NULL, NULL}};
//		
//		srna= RNA_def_struct(brna, "SpaceSequenceEditor", "Space");
//		RNA_def_struct_sdna(srna, "SpaceSeq");
//		RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor space data");
//		
//		/* view type, fairly important */
//		prop= RNA_def_property(srna, "view_type", PROP_ENUM, PROP_NONE);
//		RNA_def_property_enum_sdna(prop, NULL, "view");
//		RNA_def_property_enum_items(prop, view_type_items);
//		RNA_def_property_ui_text(prop, "View Type", "The type of the Sequencer view (sequencer, preview or both)");
//		RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
//		RNA_def_property_update(prop, 0, "rna_Sequencer_display_mode_update");
//
//		/* display type, fairly important */
//		prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
//		RNA_def_property_enum_sdna(prop, NULL, "mainb");
//		RNA_def_property_enum_items(prop, display_mode_items);
//		RNA_def_property_ui_text(prop, "Display Mode", "The view mode to use for displaying sequencer output");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
//			
//		/* flag's */
//		prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_NO_DRAW_CFRANUM);
//		RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
//		
//		prop= RNA_def_property(srna, "show_frames", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES);
//		RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather than seconds");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
//		
//		prop= RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS);
//		RNA_def_property_ui_text(prop, "Transform Markers", "Transform markers as well as strips");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
//		
//		prop= RNA_def_property(srna, "show_separate_color", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_COLOR_SEPERATED);
//		RNA_def_property_ui_text(prop, "Separate Colors", "Separate color channels in preview");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
//
//		prop= RNA_def_property(srna, "show_safe_margin", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_SAFE_MARGINS);
//		RNA_def_property_ui_text(prop, "Safe Margin", "Draw title safe margins in preview");	
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
//		
//		prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_GPENCIL);
//		RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay");	
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
//		
//		/* grease pencil */
//		prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
//		RNA_def_property_pointer_sdna(prop, NULL, "gpd");
//		RNA_def_property_struct_type(prop, "UnknownType");
//		RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
//		
//		prop= RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE);
//		RNA_def_property_int_sdna(prop, NULL, "chanshown");
//		RNA_def_property_ui_text(prop, "Display Channel", "The channel number shown in the image preview. 0 is the result of all strips combined");
//		RNA_def_property_range(prop, -5, 32); // MAXSEQ --- todo, move from BKE_sequencer.h, allow up to 5 layers up the metastack. Should be dynamic...
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
//		
//		prop= RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE);
//		RNA_def_property_int_sdna(prop, NULL, "zebra");
//		RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes");
//		RNA_def_property_range(prop, 0, 110);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
//		
//		prop= RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
//		RNA_def_property_enum_sdna(prop, NULL, "render_size");
//		RNA_def_property_enum_items(prop, proxy_render_size_items);
//		RNA_def_property_ui_text(prop, "Proxy render size", "Draw preview using full resolution or different proxy resolutions");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
//		
//		
//		/* not sure we need rna access to these but adding anyway */
//		prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE);
//		RNA_def_property_float_sdna(prop, NULL, "xof");
//		RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
//
//		prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE);
//		RNA_def_property_float_sdna(prop, NULL, "yof");
//		RNA_def_property_ui_text(prop, "Y Offset", "Offsets image horizontally from the view center");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
//		
//		prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE);
//		RNA_def_property_float_sdna(prop, NULL, "zoom");
//		RNA_def_property_ui_text(prop, "Zoom", "Display zoom level");	
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL);
//	}
//
//	static void rna_def_space_text(BlenderRNA *brna)
//	{
//		StructRNA *srna;
//		PropertyRNA *prop;
//
//		srna= RNA_def_struct(brna, "SpaceTextEditor", "Space");
//		RNA_def_struct_sdna(srna, "SpaceText");
//		RNA_def_struct_ui_text(srna, "Space Text Editor", "Text editor space data");
//
//		/* text */
//		prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
//		RNA_def_property_flag(prop, PROP_EDITABLE);
//		RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space");
//		RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL, NULL);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
//
//		/* display */
//		prop= RNA_def_property(srna, "show_word_wrap", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "wordwrap", 0);
//		RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceTextEditor_word_wrap_set");
//		RNA_def_property_ui_text(prop, "Word Wrap", "Wrap words if there is not enough horizontal space");
//		RNA_def_property_ui_icon(prop, ICON_WORDWRAP_OFF, 1);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
//
//		prop= RNA_def_property(srna, "show_line_numbers", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "showlinenrs", 0);
//		RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text");
//		RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_OFF, 1);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
//
//		prop= RNA_def_property(srna, "show_syntax_highlight", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "showsyntax", 0);
//		RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting");
//		RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 1);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
//		
//		prop= RNA_def_property(srna, "show_line_highlight", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "line_hlight", 0);
//		RNA_def_property_ui_text(prop, "Highlight Line", "Highlight the current line");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
//
//		prop= RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE);
//		RNA_def_property_int_sdna(prop, NULL, "tabnumber");
//		RNA_def_property_range(prop, 2, 8);
//		RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with");
//		RNA_def_property_update(prop, NC_TEXT|NA_EDITED, NULL);
//
//		prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE);
//		RNA_def_property_int_sdna(prop, NULL, "lheight");
//		RNA_def_property_range(prop, 8, 32);
//		RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
//
//		/* functionality options */
//		prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "overwrite", 1);
//		RNA_def_property_ui_text(prop, "Overwrite", "Overwrite characters when typing rather than inserting them");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
//		
//		prop= RNA_def_property(srna, "use_live_edit", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "live_edit", 1);
//		RNA_def_property_ui_text(prop, "Live Edit", "Run python while editing");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
//		
//		/* find */
//		prop= RNA_def_property(srna, "use_find_all", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_ALL);
//		RNA_def_property_ui_text(prop, "Find All", "Search in all text datablocks, instead of only the active one");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
//
//		prop= RNA_def_property(srna, "use_find_wrap", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_WRAP);
//		RNA_def_property_ui_text(prop, "Find Wrap", "Search again from the start of the file when reaching the end");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
//
//		prop= RNA_def_property(srna, "find_text", PROP_STRING, PROP_NONE);
//		RNA_def_property_string_sdna(prop, NULL, "findstr");
//		RNA_def_property_ui_text(prop, "Find Text", "Text to search for with the find tool");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
//
//		prop= RNA_def_property(srna, "replace_text", PROP_STRING, PROP_NONE);
//		RNA_def_property_string_sdna(prop, NULL, "replacestr");
//		RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL);
//	}
//
//	static void rna_def_space_dopesheet(BlenderRNA *brna)
//	{
//		StructRNA *srna;
//		PropertyRNA *prop;
//		
//		static EnumPropertyItem mode_items[] = {
//			{SACTCONT_DOPESHEET, "DOPESHEET", 0, "DopeSheet", ""},
//			{SACTCONT_ACTION, "ACTION", 0, "Action Editor", ""},
//			{SACTCONT_SHAPEKEY, "SHAPEKEY", 0, "ShapeKey Editor", ""},
//			//{SACTCONT_GPENCIL, "GPENCIL", 0, "Grease Pencil", ""}, // XXX: to be reimplemented, but not enough time before 2.53 - Aligorith, 2010Jul14
//			{0, NULL, 0, NULL, NULL}};
//			
//		
//		srna= RNA_def_struct(brna, "SpaceDopeSheetEditor", "Space");
//		RNA_def_struct_sdna(srna, "SpaceAction");
//		RNA_def_struct_ui_text(srna, "Space DopeSheet Editor", "DopeSheet space data");
//
//		/* data */
//		prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
//		RNA_def_property_flag(prop, PROP_EDITABLE);
//		RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL, NULL);
//		RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space");
//		RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, "rna_SpaceDopeSheetEditor_action_update");
//		
//		/* mode */
//		prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
//		RNA_def_property_enum_sdna(prop, NULL, "mode");
//		RNA_def_property_enum_items(prop, mode_items);
//		RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, "rna_SpaceDopeSheetEditor_mode_update");
//		
//		/* display */
//		prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_DRAWTIME);
//		RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
//		RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
//		
//		prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWCFRANUM);
//		RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
//		
//		prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_SLIDERS);
//		RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
//		
//		/* editing */
//		prop= RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRANSKEYCULL);
//		RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically merge nearby keyframes");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
//		
//		prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOREALTIMEUPDATES);
//		RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming keyframes, changes to the animation data are flushed to other views");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
//
//		prop= RNA_def_property(srna, "use_marker_sync", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_MARKERS_MOVE);
//		RNA_def_property_ui_text(prop, "Sync Markers", "Sync Markers with keyframe edits");
//
//		/* dopesheet */
//		prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
//		RNA_def_property_struct_type(prop, "DopeSheet");
//		RNA_def_property_pointer_sdna(prop, NULL, "ads");
//		RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
//
//		/* autosnap */
//		prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
//		RNA_def_property_enum_sdna(prop, NULL, "autosnap");
//		RNA_def_property_enum_items(prop, autosnap_items);
//		RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
//	}
//
//	static void rna_def_space_graph(BlenderRNA *brna)
//	{
//		StructRNA *srna;
//		PropertyRNA *prop;
//		
//		static EnumPropertyItem mode_items[] = {
//			{SIPO_MODE_ANIMATION, "FCURVES", 0, "F-Curve Editor", ""},
//			{SIPO_MODE_DRIVERS, "DRIVERS", 0, "Drivers", ""},
//			{0, NULL, 0, NULL, NULL}};
//			
//			/* this is basically the same as the one for the 3D-View, but with some entries ommitted */
//		static EnumPropertyItem gpivot_items[] = {
//			{V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""},
//			{V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
//			{V3D_LOCAL, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION, "Individual Centers", ""},
//			//{V3D_CENTROID, "MEDIAN_POINT", 0, "Median Point", ""},
//			//{V3D_ACTIVE, "ACTIVE_ELEMENT", 0, "Active Element", ""},
//			{0, NULL, 0, NULL, NULL}};
//
//		
//		srna= RNA_def_struct(brna, "SpaceGraphEditor", "Space");
//		RNA_def_struct_sdna(srna, "SpaceIpo");
//		RNA_def_struct_ui_text(srna, "Space Graph Editor", "Graph Editor space data");
//		
//		/* mode */
//		prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
//		RNA_def_property_enum_sdna(prop, NULL, "mode");
//		RNA_def_property_enum_items(prop, mode_items);
//		RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
//		RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, "rna_SpaceGraphEditor_display_mode_update");
//		
//		/* display */
//		prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_DRAWTIME);
//		RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
//		RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
//		
//		prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM);
//		RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
//		
//		prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SLIDERS);
//		RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
//		
//		prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOHANDLES);
//		RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
//		
//		prop= RNA_def_property(srna, "use_only_selected_curves_handles", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELCUVERTSONLY);
//		RNA_def_property_ui_text(prop, "Only Selected Curve Keyframes", "Only keyframes of selected F-Curves are visible and editable");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
//		
//		prop= RNA_def_property(srna, "use_only_selected_keyframe_handles", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELVHANDLESONLY);
//		RNA_def_property_ui_text(prop, "Only Selected Keyframes Handles", "Only show and edit handles of selected keyframes");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
//		
//		/* editing */
//		prop= RNA_def_property(srna, "use_auto_merge_keyframes", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOTRANSKEYCULL);
//		RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Automatically merge nearby keyframes");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
//		
//		prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOREALTIMEUPDATES);
//		RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming keyframes, changes to the animation data are flushed to other views");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
//		
//		/* cursor */
//		prop= RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCURSOR);
//		RNA_def_property_ui_text(prop, "Show Cursor", "Show 2D cursor");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
//		
//		prop= RNA_def_property(srna, "cursor_position_y", PROP_FLOAT, PROP_NONE);
//		RNA_def_property_float_sdna(prop, NULL, "cursorVal");
//		RNA_def_property_ui_text(prop, "Cursor Y-Value", "Graph Editor 2D-Value cursor - Y-Value component");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
//		
//		prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
//		RNA_def_property_enum_sdna(prop, NULL, "around");
//		RNA_def_property_enum_items(prop, gpivot_items);
//		RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
//
//		/* dopesheet */
//		prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
//		RNA_def_property_struct_type(prop, "DopeSheet");
//		RNA_def_property_pointer_sdna(prop, NULL, "ads");
//		RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
//
//		/* autosnap */
//		prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
//		RNA_def_property_enum_sdna(prop, NULL, "autosnap");
//		RNA_def_property_enum_items(prop, autosnap_items);
//		RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
//		
//		/* readonly state info */
//		prop= RNA_def_property(srna, "has_ghost_curves", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", 0); /* XXX: hack to make this compile, since this property doesn't actually exist*/
//		RNA_def_property_boolean_funcs(prop, "rna_SpaceGraphEditor_has_ghost_curves_get", NULL);
//		RNA_def_property_ui_text(prop, "Has Ghost Curves", "Graph Editor instance has some ghost curves stored");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
//	}
//
//	static void rna_def_space_nla(BlenderRNA *brna)
//	{
//		StructRNA *srna;
//		PropertyRNA *prop;
//		
//		srna= RNA_def_struct(brna, "SpaceNLA", "Space");
//		RNA_def_struct_sdna(srna, "SpaceNla");
//		RNA_def_struct_ui_text(srna, "Space Nla Editor", "NLA editor space data");
//		
//		/* display */
//		prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", SNLA_DRAWTIME);
//		RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator
//		RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
//		
//		prop= RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NODRAWCFRANUM);
//		RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
//		
//		prop= RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOSTRIPCURVES);
//		RNA_def_property_ui_text(prop, "Show Control Curves", "Show influence curves on strips");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
//		
//		/* editing */
//		prop= RNA_def_property(srna, "use_realtime_update", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOREALTIMEUPDATES);
//		RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming strips, changes to the animation data are flushed to other views");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
//
//		/* dopesheet */
//		prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
//		RNA_def_property_struct_type(prop, "DopeSheet");
//		RNA_def_property_pointer_sdna(prop, NULL, "ads");
//		RNA_def_property_ui_text(prop, "DopeSheet", "Settings for filtering animation data");
//
//		/* autosnap */
//		prop= RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
//		RNA_def_property_enum_sdna(prop, NULL, "autosnap");
//		RNA_def_property_enum_items(prop, autosnap_items);
//		RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
//	}

	public static void rna_def_space_time(BlenderRNA brna)
	{
		StructRNA srna;
		PropertyRNA prop;
		
		srna= RnaDefine.RNA_def_struct(brna, "SpaceTimeline", "Space");
		RnaDefine.RNA_def_struct_sdna(srna, "SpaceTime");
		RnaDefine.RNA_def_struct_ui_text(srna, "Space Timeline Editor", "Timeline editor space data");
		
		/* Define Anim Playback Areas */
		prop= RnaDefine.RNA_def_property(srna, "use_play_top_left_3d_editor", RNATypes.PROP_BOOLEAN, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_boolean_sdna(prop, null, "redraws", TIME_REGION);
		RnaDefine.RNA_def_property_ui_text(prop, "Top-Left 3D Editor", "");
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
		
		prop= RnaDefine.RNA_def_property(srna, "use_play_3d_editors", RNATypes.PROP_BOOLEAN, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_boolean_sdna(prop, null, "redraws", TIME_ALL_3D_WIN);
		RnaDefine.RNA_def_property_ui_text(prop, "All 3D View Editors", "");
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
		
		prop= RnaDefine.RNA_def_property(srna, "use_play_animation_editors", RNATypes.PROP_BOOLEAN, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_boolean_sdna(prop, null, "redraws", TIME_ALL_ANIM_WIN);
		RnaDefine.RNA_def_property_ui_text(prop, "Animation Editors", "");
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
		
		prop= RnaDefine.RNA_def_property(srna, "use_play_properties_editors", RNATypes.PROP_BOOLEAN, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_boolean_sdna(prop, null, "redraws", TIME_ALL_BUTS_WIN);
		RnaDefine.RNA_def_property_ui_text(prop, "Property Editors", "");
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
		
		prop= RnaDefine.RNA_def_property(srna, "use_play_image_editors", RNATypes.PROP_BOOLEAN, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_boolean_sdna(prop, null, "redraws", TIME_ALL_IMAGE_WIN);
		RnaDefine.RNA_def_property_ui_text(prop, "Image Editors", "");
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
		
		prop= RnaDefine.RNA_def_property(srna, "use_play_sequence_editors", RNATypes.PROP_BOOLEAN, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_boolean_sdna(prop, null, "redraws", TIME_SEQ);
		RnaDefine.RNA_def_property_ui_text(prop, "Sequencer Editors", "");
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
		
		prop= RnaDefine.RNA_def_property(srna, "use_play_node_editors", RNATypes.PROP_BOOLEAN, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_boolean_sdna(prop, null, "redraws", TIME_NODES);
		RnaDefine.RNA_def_property_ui_text(prop, "Node Editors", "");
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
		
		/* Other options */	
		prop= RnaDefine.RNA_def_property(srna, "show_only_selected", RNATypes.PROP_BOOLEAN, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_boolean_sdna(prop, null, "flag", TIME_ONLYACTSEL);
		RnaDefine.RNA_def_property_ui_text(prop, "Only Selected channels", "Show keyframes for active Object and/or its selected channels only");	
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, null);
		
		prop= RnaDefine.RNA_def_property(srna, "show_frame_indicator", RNATypes.PROP_BOOLEAN, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_boolean_sdna(prop, null, "flag", TIME_CFRA_NUM);
		RnaDefine.RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line");
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, null);
		
		/* displaying cache status */
		prop= RnaDefine.RNA_def_property(srna, "show_cache", RNATypes.PROP_BOOLEAN, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_boolean_sdna(prop, null, "cache_display", TIME_CACHE_DISPLAY);
		RnaDefine.RNA_def_property_ui_text(prop, "Show Cache", "Show the status of cached frames in the timeline");	
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, null);
		
		prop= RnaDefine.RNA_def_property(srna, "cache_softbody", RNATypes.PROP_BOOLEAN, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_boolean_sdna(prop, null, "cache_display", TIME_CACHE_SOFTBODY);
		RnaDefine.RNA_def_property_ui_text(prop, "Softbody", "Show the active object's softbody point cache");	
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, null);
		
		prop= RnaDefine.RNA_def_property(srna, "cache_particles", RNATypes.PROP_BOOLEAN, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_boolean_sdna(prop, null, "cache_display", TIME_CACHE_PARTICLES);
		RnaDefine.RNA_def_property_ui_text(prop, "Particles", "Show the active object's particle point cache");	
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, null);
		
		prop= RnaDefine.RNA_def_property(srna, "cache_cloth", RNATypes.PROP_BOOLEAN, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_boolean_sdna(prop, null, "cache_display", TIME_CACHE_CLOTH);
		RnaDefine.RNA_def_property_ui_text(prop, "Cloth", "Show the active object's cloth point cache");	
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, null);
		
		prop= RnaDefine.RNA_def_property(srna, "cache_smoke", RNATypes.PROP_BOOLEAN, RNATypes.PROP_NONE);
		RnaDefine.RNA_def_property_boolean_sdna(prop, null, "cache_display", TIME_CACHE_SMOKE);
		RnaDefine.RNA_def_property_ui_text(prop, "Smoke", "Show the active object's smoke cache");	
		RnaDefine.RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, null);
	}

//	static void rna_def_console_line(BlenderRNA *brna)
//	{
//		StructRNA *srna;
//		PropertyRNA *prop;
//		
//		srna = RNA_def_struct(brna, "ConsoleLine", NULL);
//		RNA_def_struct_ui_text(srna, "Console Input", "Input line for the interactive console");
//		// XXX using non-inited "prop", uh? RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
//		
//		prop= RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
//		RNA_def_property_string_funcs(prop, "rna_ConsoleLine_body_get", "rna_ConsoleLine_body_length", "rna_ConsoleLine_body_set");
//		RNA_def_property_ui_text(prop, "Line", "Text in the line");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
//		
//		prop= RNA_def_property(srna, "current_character", PROP_INT, PROP_NONE); /* copied from text editor */
//		RNA_def_property_int_sdna(prop, NULL, "cursor");
//		RNA_def_property_int_funcs(prop, NULL, NULL, "rna_ConsoleLine_cursor_index_range");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
//	}
//		
//	static void rna_def_space_console(BlenderRNA *brna)
//	{
//		StructRNA *srna;
//		PropertyRNA *prop;
//		
//		srna= RNA_def_struct(brna, "SpaceConsole", "Space");
//		RNA_def_struct_sdna(srna, "SpaceConsole");
//		RNA_def_struct_ui_text(srna, "Space Console", "Interactive python console");
//		
//		/* display */
//		prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); /* copied from text editor */
//		RNA_def_property_int_sdna(prop, NULL, "lheight");
//		RNA_def_property_range(prop, 8, 32);
//		RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
//
//
//		prop= RNA_def_property(srna, "select_start", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
//		RNA_def_property_int_sdna(prop, NULL, "sel_start");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
//		
//		prop= RNA_def_property(srna, "select_end", PROP_INT, PROP_UNSIGNED); /* copied from text editor */
//		RNA_def_property_int_sdna(prop, NULL, "sel_end");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL);
//
//		prop= RNA_def_property(srna, "prompt", PROP_STRING, PROP_NONE);
//		RNA_def_property_ui_text(prop, "Prompt", "Command line prompt");
//		
//		prop= RNA_def_property(srna, "language", PROP_STRING, PROP_NONE);
//		RNA_def_property_ui_text(prop, "Language", "Command line prompt language");
//
//		prop= RNA_def_property(srna, "history", PROP_COLLECTION, PROP_NONE);
//		RNA_def_property_collection_sdna(prop, NULL, "history", NULL);
//		RNA_def_property_struct_type(prop, "ConsoleLine");
//		RNA_def_property_ui_text(prop, "History", "Command history");
//		
//		prop= RNA_def_property(srna, "scrollback", PROP_COLLECTION, PROP_NONE);
//		RNA_def_property_collection_sdna(prop, NULL, "scrollback", NULL);
//		RNA_def_property_struct_type(prop, "ConsoleLine");
//		RNA_def_property_ui_text(prop, "Output", "Command output");
//	}
//
//	static void rna_def_fileselect_params(BlenderRNA *brna)
//	{
//		StructRNA *srna;
//		PropertyRNA *prop;
//		
//		static EnumPropertyItem file_display_items[] = {
//			{FILE_SHORTDISPLAY, "FILE_SHORTDISPLAY", ICON_SHORTDISPLAY, "Short List", "Display files as short list"},
//			{FILE_LONGDISPLAY, "FILE_LONGDISPLAY", ICON_LONGDISPLAY, "Long List", "Display files as a detailed list"},
//			{FILE_IMGDISPLAY, "FILE_IMGDISPLAY", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"},
//			{0, NULL, 0, NULL, NULL}};
//
//		static EnumPropertyItem file_sort_items[] = {
//			{FILE_SORT_ALPHA, "FILE_SORT_ALPHA", ICON_SORTALPHA, "Sort alphabetically", "Sort the file list alphabetically"},
//			{FILE_SORT_EXTENSION, "FILE_SORT_EXTENSION", ICON_SORTBYEXT, "Sort by extension", "Sort the file list by extension"},
//			{FILE_SORT_TIME, "FILE_SORT_TIME", ICON_SORTTIME, "Sort by time", "Sort files by modification time"},
//			{FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_SORTSIZE, "Sort by size", "Sort files by size"},
//			{0, NULL, 0, NULL, NULL}};
//
//		srna= RNA_def_struct(brna, "FileSelectParams", NULL);
//		RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters");
//
//		prop= RNA_def_property(srna, "title", PROP_STRING, PROP_NONE);
//		RNA_def_property_string_sdna(prop, NULL, "title");
//		RNA_def_property_ui_text(prop, "Title", "Title for the file browser");
//		RNA_def_property_clear_flag(prop, PROP_EDITABLE);
//
//		prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
//		RNA_def_property_string_sdna(prop, NULL, "dir");
//		RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
//
//		prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME);
//		RNA_def_property_string_sdna(prop, NULL, "file");
//		RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
//
//		prop= RNA_def_property(srna, "display_type", PROP_ENUM, PROP_NONE);
//		RNA_def_property_enum_sdna(prop, NULL, "display");
//		RNA_def_property_enum_items(prop, file_display_items);
//		RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
//
//		prop= RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_FILTER);
//		RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
//
//		prop= RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FILE_HIDE_DOT);
//		RNA_def_property_ui_text(prop, "Show Hidden", "Show hidden dot files");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS , NULL);
//
//		prop= RNA_def_property(srna, "sort_method", PROP_ENUM, PROP_NONE);
//		RNA_def_property_enum_sdna(prop, NULL, "sort");
//		RNA_def_property_enum_items(prop, file_sort_items);
//		RNA_def_property_ui_text(prop, "Sort", "");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
//
//		prop= RNA_def_property(srna, "use_filter_image", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "filter", IMAGEFILE);
//		RNA_def_property_ui_text(prop, "Filter Images", "Show image files");
//		RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
//
//		prop= RNA_def_property(srna, "use_filter_blender", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "filter", BLENDERFILE);
//		RNA_def_property_ui_text(prop, "Filter Blender", "Show .blend files");
//		RNA_def_property_ui_icon(prop, ICON_FILE_BLEND, 0);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
//
//		prop= RNA_def_property(srna, "use_filter_movie", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "filter", MOVIEFILE);
//		RNA_def_property_ui_text(prop, "Filter Movies", "Show movie files");
//		RNA_def_property_ui_icon(prop, ICON_FILE_MOVIE, 0);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
//
//		prop= RNA_def_property(srna, "use_filter_script", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "filter", PYSCRIPTFILE);
//		RNA_def_property_ui_text(prop, "Filter Script", "Show script files");
//		RNA_def_property_ui_icon(prop, ICON_FILE_SCRIPT, 0);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
//
//		prop= RNA_def_property(srna, "use_filter_font", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "filter", FTFONTFILE);
//		RNA_def_property_ui_text(prop, "Filter Fonts", "Show font files");
//		RNA_def_property_ui_icon(prop, ICON_FILE_FONT, 0);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
//
//		prop= RNA_def_property(srna, "use_filter_sound", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "filter", SOUNDFILE);
//		RNA_def_property_ui_text(prop, "Filter Sound", "Show sound files");
//		RNA_def_property_ui_icon(prop, ICON_FILE_SOUND, 0);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
//
//		prop= RNA_def_property(srna, "use_filter_text", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "filter", TEXTFILE);
//		RNA_def_property_ui_text(prop, "Filter Text", "Show text files");
//		RNA_def_property_ui_icon(prop, ICON_FILE_BLANK, 0);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
//
//		prop= RNA_def_property(srna, "use_filter_folder", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "filter", FOLDERFILE);
//		RNA_def_property_ui_text(prop, "Filter Folder", "Show folders");
//		RNA_def_property_ui_icon(prop, ICON_FILE_FOLDER, 0);
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL);
//		
//		prop= RNA_def_property(srna, "filter_glob", PROP_STRING, PROP_NONE);
//		RNA_def_property_string_sdna(prop, NULL, "filter_glob");
//		RNA_def_property_ui_text(prop, "Extension Filter", "");
//		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
//
//	}
//
//	static void rna_def_space_filebrowser(BlenderRNA *brna)
//	{
//		StructRNA *srna;
//		PropertyRNA *prop;
//
//		srna= RNA_def_struct(brna, "SpaceFileBrowser", "Space");
//		RNA_def_struct_sdna(srna, "SpaceFile");
//		RNA_def_struct_ui_text(srna, "Space File Browser", "File browser space data");
//
//		prop= RNA_def_property(srna, "params", PROP_POINTER, PROP_NONE);
//		RNA_def_property_pointer_sdna(prop, NULL, "params");
//		RNA_def_property_ui_text(prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser");
//		
//		prop= RNA_def_property(srna, "operator", PROP_POINTER, PROP_NONE);
//		RNA_def_property_pointer_sdna(prop, NULL, "op");
//		RNA_def_property_ui_text(prop, "Operator", "");
//	}

	static void rna_def_space_info(BlenderRNA brna)
	{
		StructRNA srna;
		PropertyRNA prop;

		srna= RNA_def_struct(brna, "SpaceInfo", "Space");
		RNA_def_struct_sdna(srna, "SpaceInfo");
		RNA_def_struct_ui_text(srna, "Space Info", "Info space data");
		
		/* reporting display */
		prop= RNA_def_property(srna, "show_report_debug", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "rpt_mask", INFO_RPT_DEBUG);
		RNA_def_property_ui_text(prop, "Show Debug", "Display debug reporting info");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, null);
		
		prop= RNA_def_property(srna, "show_report_info", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "rpt_mask", INFO_RPT_INFO);
		RNA_def_property_ui_text(prop, "Show Info", "Display general information");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, null);
		
		prop= RNA_def_property(srna, "show_report_operator", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "rpt_mask", INFO_RPT_OP);
		RNA_def_property_ui_text(prop, "Show Operator", "Display the operator log");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, null);
		
		prop= RNA_def_property(srna, "show_report_warning", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "rpt_mask", INFO_RPT_WARN);
		RNA_def_property_ui_text(prop, "Show Warn", "Display warnings");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, null);
		
		prop= RNA_def_property(srna, "show_report_error", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "rpt_mask", INFO_RPT_ERR);
		RNA_def_property_ui_text(prop, "Show Error", "Display error text");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_INFO_REPORT, null);	
	}

//	static void rna_def_space_userpref(BlenderRNA *brna)
//	{
//		StructRNA *srna;
//		PropertyRNA *prop;
//		
//		srna= RNA_def_struct(brna, "SpaceUserPreferences", "Space");
//		RNA_def_struct_sdna(srna, "SpaceUserPref");
//		RNA_def_struct_ui_text(srna, "Space User Preferences", "User preferences space data");
//		
//		prop= RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE);
//		RNA_def_property_string_sdna(prop, NULL, "filter");
//		RNA_def_property_ui_text(prop, "Filter", "Search term for filtering in the UI");
//
//	}
	
	public static EnumPropertyItem texture_type_items[] = {
			new EnumPropertyItem(SNODE_TEX_OBJECT, "OBJECT", BIFIconID.ICON_OBJECT_DATA, "Object", "Edit texture nodes from Object"),
			new EnumPropertyItem(SNODE_TEX_WORLD, "WORLD", BIFIconID.ICON_WORLD_DATA, "World", "Edit texture nodes from World"),
			new EnumPropertyItem(SNODE_TEX_BRUSH, "BRUSH", BIFIconID.ICON_BRUSH_DATA, "Brush", "Edit texture nodes from Brush"),
			new EnumPropertyItem(0, null, 0, null, null)};

	public static void rna_def_space_node(BlenderRNA brna)
	{
		StructRNA srna;
		PropertyRNA prop;

		EnumPropertyItem tree_type_items[] = {
				new EnumPropertyItem(NTREE_SHADER, "MATERIAL", BIFIconID.ICON_MATERIAL, "Material", "Material nodes"),
				new EnumPropertyItem(NTREE_TEXTURE, "TEXTURE", BIFIconID.ICON_TEXTURE, "Texture", "Texture nodes"),
				new EnumPropertyItem(NTREE_COMPOSIT, "COMPOSITING", BIFIconID.ICON_RENDERLAYERS, "Compositing", "Compositing nodes"),
				new EnumPropertyItem(0, null, 0, null, null)};

		srna= RNA_def_struct(brna, "SpaceNodeEditor", "Space");
		RNA_def_struct_sdna(srna, "SpaceNode");
		RNA_def_struct_ui_text(srna, "Space Node Editor", "Node editor space data");

		prop= RNA_def_property(srna, "tree_type", PROP_ENUM, PROP_NONE);
		RNA_def_property_enum_sdna(prop, null, "treetype");
		RNA_def_property_enum_items(prop, tree_type_items);
		RNA_def_property_ui_text(prop, "Tree Type", "Node tree type to display and edit");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, null);

		prop= RNA_def_property(srna, "texture_type", PROP_ENUM, PROP_NONE);
		RNA_def_property_enum_sdna(prop, null, "texfrom");
		RNA_def_property_enum_items(prop, texture_type_items);
		RNA_def_property_ui_text(prop, "Texture Type", "Type of data to take texture from");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, null);

		prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
		RNA_def_property_clear_flag(prop, PROP_EDITABLE);
		RNA_def_property_ui_text(prop, "ID", "Datablock whose nodes are being edited");

		prop= RNA_def_property(srna, "id_from", PROP_POINTER, PROP_NONE);
		RNA_def_property_pointer_sdna(prop, null, "from");
		RNA_def_property_clear_flag(prop, PROP_EDITABLE);
		RNA_def_property_ui_text(prop, "ID From", "Datablock from which the edited datablock is linked");

		prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
		RNA_def_property_pointer_sdna(prop, null, "nodetree");
		RNA_def_property_clear_flag(prop, PROP_EDITABLE);
		RNA_def_property_ui_text(prop, "Node Tree", "Node tree being displayed and edited");

		prop= RNA_def_property(srna, "show_backdrop", PROP_BOOLEAN, PROP_NONE);
		RNA_def_property_boolean_sdna(prop, null, "flag", SNODE_BACKDRAW);
		RNA_def_property_ui_text(prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes");
		RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, null);
	}

//	static void rna_def_space_logic(BlenderRNA *brna)
//	{
//		StructRNA *srna;
//		PropertyRNA *prop;
//
//		srna= RNA_def_struct(brna, "SpaceLogicEditor", "Space");
//		RNA_def_struct_sdna(srna, "SpaceLogic");
//		RNA_def_struct_ui_text(srna, "Space Logic Editor", "Logic editor space data");
//
//		/* sensors */
//		prop= RNA_def_property(srna, "show_sensors_selected_objects", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_SEL);
//		RNA_def_property_ui_text(prop, "Show Selected Object", "Show sensors of all selected objects");
//		RNA_def_property_update(prop, NC_LOGIC, NULL);
//		
//		prop= RNA_def_property(srna, "show_sensors_active_object", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_ACT);
//		RNA_def_property_ui_text(prop, "Show Active Object", "Show sensors of active object");
//		RNA_def_property_update(prop, NC_LOGIC, NULL);
//		
//		prop= RNA_def_property(srna, "show_sensors_linked_controller", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_LINK);
//		RNA_def_property_ui_text(prop, "Show Linked to Controller", "Show linked objects to the controller");
//		RNA_def_property_update(prop, NC_LOGIC, NULL);
//
//		prop= RNA_def_property(srna, "show_sensors_active_states", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_SENS_STATE);
//		RNA_def_property_ui_text(prop, "Show Active States", "Show only sensors connected to active states");
//		RNA_def_property_update(prop, NC_LOGIC, NULL);
//
//		/* controllers */
//		prop= RNA_def_property(srna, "show_controllers_selected_objects", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_SEL);
//		RNA_def_property_ui_text(prop, "Show Selected Object", "Show controllers of all selected objects");
//		RNA_def_property_update(prop, NC_LOGIC, NULL);
//		
//		prop= RNA_def_property(srna, "show_controllers_active_object", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_ACT);
//		RNA_def_property_ui_text(prop, "Show Active Object", "Show controllers of active object");
//		RNA_def_property_update(prop, NC_LOGIC, NULL);
//
//		prop= RNA_def_property(srna, "show_controllers_linked_controller", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_CONT_LINK);
//		RNA_def_property_ui_text(prop, "Show Linked to Controller", "Show linked objects to sensor/actuator");
//		RNA_def_property_update(prop, NC_LOGIC, NULL);
//
//		/* actuators */
//		prop= RNA_def_property(srna, "show_actuators_selected_objects", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_SEL);
//		RNA_def_property_ui_text(prop, "Show Selected Object", "Show actuators of all selected objects");
//		RNA_def_property_update(prop, NC_LOGIC, NULL);
//		
//		prop= RNA_def_property(srna, "show_actuators_active_object", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_ACT);
//		RNA_def_property_ui_text(prop, "Show Active Object", "Show actuators of active object");
//		RNA_def_property_update(prop, NC_LOGIC, NULL);
//		
//		prop= RNA_def_property(srna, "show_actuators_linked_controller", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_LINK);
//		RNA_def_property_ui_text(prop, "Show Linked to Actuator", "Show linked objects to the actuator");
//		RNA_def_property_update(prop, NC_LOGIC, NULL);
//
//		prop= RNA_def_property(srna, "show_actuators_active_states", PROP_BOOLEAN, PROP_NONE);
//		RNA_def_property_boolean_sdna(prop, NULL, "scaflag", BUTS_ACT_STATE);
//		RNA_def_property_ui_text(prop, "Show Active States", "Show only actuators connected to active states");
//		RNA_def_property_update(prop, NC_LOGIC, NULL);
//
//	}

	public static RNAProcess RNA_def_space = new RNAProcess() {
	public void run(BlenderRNA brna)
	{
		rna_def_space(brna);
//		rna_def_space_image(brna);
//		rna_def_space_sequencer(brna);
//		rna_def_space_text(brna);
//		rna_def_fileselect_params(brna);
//		rna_def_space_filebrowser(brna);
		rna_def_space_outliner(brna);
//		rna_def_background_image(brna);
		rna_def_space_view3d(brna);
		rna_def_space_buttons(brna);
//		rna_def_space_dopesheet(brna);
//		rna_def_space_graph(brna);
//		rna_def_space_nla(brna);
		rna_def_space_time(brna);
//		rna_def_space_console(brna);
//		rna_def_console_line(brna);
		rna_def_space_info(brna);
//		rna_def_space_userpref(brna);
		rna_def_space_node(brna);
//		rna_def_space_logic(brna);
	}};
	
//	public static RNAProcess RNA_def_space_outliner = new RNAProcess() {
//	public void run(BlenderRNA brna)
//	{
//		rna_def_space_outliner(brna);
//	}};
//		
//	public static RNAProcess RNA_def_space_view3d = new RNAProcess() {
//	public void run(BlenderRNA brna)
//	{
//		rna_def_space_view3d(brna);
//	}};
//			
//	public static RNAProcess RNA_def_space_buttons = new RNAProcess() {
//	public void run(BlenderRNA brna)
//	{
//		rna_def_space_buttons(brna);
//	}};
//				
//	public static RNAProcess RNA_def_space_time = new RNAProcess() {
//	public void run(BlenderRNA brna)
//	{
//		rna_def_space_time(brna);
//	}};
//					
//	public static RNAProcess RNA_def_space_info = new RNAProcess() {
//	public void run(BlenderRNA brna)
//	{
//		rna_def_space_info(brna);
//	}};

//	#endif

}
